diff options
-rw-r--r-- | unittest/conftest.py | 8 | ||||
-rw-r--r-- | unittest/test_pro.py | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/unittest/conftest.py b/unittest/conftest.py index 49b4f02..1377e50 100644 --- a/unittest/conftest.py +++ b/unittest/conftest.py @@ -155,3 +155,11 @@ def get_library(request, allow_offline=False): return AttrProxy(C, "libnitrokey C") + +def pytest_addoption(parser): + parser.addoption("--run-skipped", action="store_true", + help="run the tests skipped by default, e.g. adding side effects") + +def pytest_runtest_setup(item): + if 'skip_by_default' in item.keywords and not item.config.getoption("--run-skipped"): + pytest.skip("need --run-skipped option to run this test")
\ No newline at end of file diff --git a/unittest/test_pro.py b/unittest/test_pro.py index 3a324bb..a47d804 100644 --- a/unittest/test_pro.py +++ b/unittest/test_pro.py @@ -1014,7 +1014,7 @@ def test_bootloader_run_pro_wrong_password(C): assert C.NK_enable_firmware_update_pro(DefaultPasswords.UPDATE_TEMP) == DeviceErrorCode.WRONG_PASSWORD -@pytest.mark.skip +@pytest.mark.skip_by_default @pytest.mark.firmware def test_bootloader_run_pro_real(C): # Not enabled due to lack of side-effect removal at this point |