|
2 | 2 | from typing import Generator, List, Optional
|
3 | 3 | from pathlib import Path
|
4 | 4 | from ledgered.manifest import Manifest
|
| 5 | +from unittest.mock import MagicMock |
| 6 | + |
5 | 7 | from ragger.firmware import Firmware
|
6 | 8 | from ragger.backend import BackendInterface, SpeculosBackend, LedgerCommBackend, LedgerWalletBackend
|
7 | 9 | from ragger.navigator import Navigator, NanoNavigator, TouchNavigator, NavigateWithScenario
|
|
28 | 30 | def pytest_addoption(parser):
|
29 | 31 | parser.addoption("--device", choices=DEVICES, required=True)
|
30 | 32 | parser.addoption("--backend", choices=BACKENDS, default="speculos")
|
| 33 | + parser.addoption("--no-nav", action="store_true", default=False, help="Disable the navigation") |
31 | 34 | parser.addoption("--display",
|
32 | 35 | action="store_true",
|
33 | 36 | default=False,
|
@@ -61,6 +64,11 @@ def verbose(pytestconfig):
|
61 | 64 | return pytestconfig.getoption("Verbose")
|
62 | 65 |
|
63 | 66 |
|
| 67 | +@pytest.fixture(scope="session") |
| 68 | +def navigation(pytestconfig): |
| 69 | + return not pytestconfig.getoption("no_nav") |
| 70 | + |
| 71 | + |
64 | 72 | @pytest.fixture(scope="session")
|
65 | 73 | def backend_name(pytestconfig):
|
66 | 74 | return pytestconfig.getoption("backend")
|
@@ -295,7 +303,11 @@ def backend(skip_tests_for_unsupported_devices, root_pytest_dir: Path, backend_n
|
295 | 303 |
|
296 | 304 |
|
297 | 305 | @pytest.fixture(scope=conf.OPTIONAL.BACKEND_SCOPE)
|
298 |
| -def navigator(backend: BackendInterface, firmware: Firmware, golden_run: bool): |
| 306 | +def navigator(backend: BackendInterface, firmware: Firmware, golden_run: bool, display: bool, |
| 307 | + navigation: bool): |
| 308 | + if not navigation: |
| 309 | + return MagicMock() |
| 310 | + |
299 | 311 | if firmware.is_nano:
|
300 | 312 | return NanoNavigator(backend, firmware, golden_run)
|
301 | 313 | else:
|
|
0 commit comments