diff options
-rw-r--r-- | pyagl/conftest.py | 10 | ||||
-rw-r--r-- | pyagl/tests/test_signal_composer.py | 6 |
2 files changed, 13 insertions, 3 deletions
diff --git a/pyagl/conftest.py b/pyagl/conftest.py index dd4dc31..0d470d6 100644 --- a/pyagl/conftest.py +++ b/pyagl/conftest.py @@ -37,6 +37,9 @@ class LavaAction(argparse.Action): def pytest_addoption(parser): parser.addoption('-L', '--lava', action=LavaAction, help='enable LAVA signals') + # Hook to allow not skipping signal-composer tests for debugging + parser.addoption('--run-signal-composer', action='store_true', default=False, help='run signal-composer tests') + def pytest_configure(config): # Force normal progress and verbose output off when doing LAVA output @@ -145,3 +148,10 @@ def pytest_collection_modifyitems(config, items): for item in items: if "can_j1939" in item.keywords: item.add_marker(skip_j1939) + + # For now, skip signal-composer tests if not explicitly enabled + if not config.getoption("--run-signal-composer"): + skip_signal_composer = pytest.mark.skip(reason="need --run-signal-composer option to run") + for item in items: + if "signal_composer" in item.keywords: + item.add_marker(skip_signal_composer) diff --git a/pyagl/tests/test_signal_composer.py b/pyagl/tests/test_signal_composer.py index dfc002b..19847a6 100644 --- a/pyagl/tests/test_signal_composer.py +++ b/pyagl/tests/test_signal_composer.py @@ -22,7 +22,7 @@ from pyagl.services.base import AFBResponse, AFBT from pyagl.services.signal_composer import SignalComposerService as scs -pytestmark = [pytest.mark.asyncio, pytest.mark.can_low_level] +pytestmark = [pytest.mark.asyncio, pytest.mark.signal_composer] @pytest.fixture(scope='module') @@ -40,7 +40,7 @@ async def service(): await ns.websocket.close() -@pytest.mark.dependency +@pytest.mark.dependency() async def test_list(event_loop, service: scs): msgid = await service.list() resp = await service.afbresponse() @@ -56,7 +56,6 @@ async def test_getNoFilter(event_loop, service: scs): @pytest.mark.dependency(depends=['test_list']) -@pytest.mark.xfail(reason='on first boot enumerating through all signals causes the service to crash, restarting it fixes it') async def test_getAllSignals(event_loop, service: scs): msgid = await service.list() resp = await service.afbresponse() @@ -66,6 +65,7 @@ async def test_getAllSignals(event_loop, service: scs): resp = await service.afbresponse() assert resp.status == 'success', f'get() with signal {s} failed, info: {resp.info}' + # while rewriting the old lua tests this one tries to 'get' 'odometer' signal but its not currently present # async def test_getFilterAvg(event_loop, service: scs): # msgid = await service.get({'signal': 'odometer', 'options': {'average': 10}}) |