Refactor: rename SimDUT, restructure DUT simulation and test flow
This commit is contained in:
25
conftest.py
25
conftest.py
@@ -0,0 +1,25 @@
|
||||
import pytest
|
||||
from src.instruments.real_dut import RealDUT
|
||||
from src.instruments.simulated_dut import SimulatedDUT
|
||||
from src.instruments.power_supply import PowerSupply
|
||||
from src.interfaces.dummy import DummyBackend
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption("--sim", action="store_true", help="Use simulation mode")
|
||||
|
||||
@pytest.fixture
|
||||
def sim_mode(request):
|
||||
return request.config.getoption("--sim")
|
||||
|
||||
@pytest.fixture
|
||||
def dut(sim_mode):
|
||||
if sim_mode:
|
||||
return SimulatedDUT()
|
||||
return RealDUT()
|
||||
|
||||
@pytest.fixture
|
||||
def power_supply(sim_mode):
|
||||
if sim_mode:
|
||||
return PowerSupply(DummyBackend())
|
||||
# TODO: Replace with real SCPI interface when ready
|
||||
raise NotImplementedError("Real power supply interface not yet implemented")
|
||||
Reference in New Issue
Block a user