diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2020-01-28 14:45:34 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2020-02-26 12:26:20 +0100 |
commit | ec767410d860688f32ef644e9573841272d5aec2 (patch) | |
tree | fbe635a81160069ce077e1f76289d32a93e6d55d /unittest | |
parent | 73251ccf5abae5ae91f2aa962a29dce6fcc0e5e4 (diff) | |
download | libnitrokey-ec767410d860688f32ef644e9573841272d5aec2.tar.gz libnitrokey-ec767410d860688f32ef644e9573841272d5aec2.tar.bz2 |
Skip bootloader activation unless specified by the switch
Diffstat (limited to 'unittest')
-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 |