|
|
|
@ -111,17 +111,17 @@ def pytest_runtest_setup(item):
|
|
|
|
|
* no test should have both skips at the same time
|
|
|
|
|
* allows to 'runxfail' tests specified by 'run_xfail' in pytest.ini
|
|
|
|
|
"""
|
|
|
|
|
if item.get_marker("skip_t1") and item.get_marker("skip_t2"):
|
|
|
|
|
if item.get_closest_marker("skip_t1") and item.get_closest_marker("skip_t2"):
|
|
|
|
|
pytest.fail("Don't skip tests for both trezors!")
|
|
|
|
|
|
|
|
|
|
if item.get_marker("skip_t2") and TREZOR_VERSION == 2:
|
|
|
|
|
if item.get_closest_marker("skip_t2") and TREZOR_VERSION == 2:
|
|
|
|
|
pytest.skip("Test excluded on Trezor T")
|
|
|
|
|
if item.get_marker("skip_t1") and TREZOR_VERSION == 1:
|
|
|
|
|
if item.get_closest_marker("skip_t1") and TREZOR_VERSION == 1:
|
|
|
|
|
pytest.skip("Test excluded on Trezor 1")
|
|
|
|
|
|
|
|
|
|
xfail = item.get_marker("xfail")
|
|
|
|
|
xfail = item.get_closest_marker("xfail")
|
|
|
|
|
runxfail_markers = item.config.getini("run_xfail")
|
|
|
|
|
run_xfail = any(item.get_marker(marker) for marker in runxfail_markers)
|
|
|
|
|
run_xfail = any(item.get_closest_marker(marker) for marker in runxfail_markers)
|
|
|
|
|
if xfail and run_xfail:
|
|
|
|
|
# Deep hack: pytest's private _evalxfail helper determines whether the test should xfail or not.
|
|
|
|
|
# The helper caches its result even before this hook runs.
|
|
|
|
|