25 lines
753 B
Python
25 lines
753 B
Python
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") |