Revert "Use pytest-platform-markers"
This reverts commit 2e12fb3c65
.
It seems like it's currently broken...
This commit is contained in:
parent
a4687c6745
commit
48f87d1656
@ -3,11 +3,19 @@ norecursedirs = .tox .venv
|
||||
addopts = --strict -rfEsw --faulthandler-timeout=70 --instafail
|
||||
markers =
|
||||
gui: Tests using the GUI (e.g. spawning widgets)
|
||||
posix: Tests which only can run on a POSIX OS.
|
||||
windows: Tests which only can run on Windows.
|
||||
linux: Tests which only can run on Linux.
|
||||
osx: Tests which only can run on OS X.
|
||||
not_osx: Tests which can not run on OS X.
|
||||
not_frozen: Tests which can't be run if sys.frozen is True.
|
||||
no_xvfb: Tests which can't be run with Xvfb.
|
||||
frozen: Tests which can only be run if sys.frozen is True.
|
||||
integration: Tests which test a bigger portion of code, run without coverage.
|
||||
skip: Always skipped test.
|
||||
pyqt531_or_newer: Needs PyQt 5.3.1 or newer.
|
||||
xfail_norun: xfail the test with out running it
|
||||
ci: Tests which should only run on CI.
|
||||
qt_log_level_fail = WARNING
|
||||
qt_log_ignore =
|
||||
^SpellCheck: .*
|
||||
|
@ -45,17 +45,33 @@ hypothesis.settings.load_profile('default')
|
||||
def _apply_platform_markers(item):
|
||||
"""Apply a skip marker to a given item."""
|
||||
markers = [
|
||||
('posix', os.name != 'posix', "Requires a POSIX os"),
|
||||
('windows', os.name != 'nt', "Requires Windows"),
|
||||
('linux', not sys.platform.startswith('linux'), "Requires Linux"),
|
||||
('osx', sys.platform != 'darwin', "Requires OS X"),
|
||||
('not_osx', sys.platform == 'darwin', "Skipped on OS X"),
|
||||
('not_frozen', getattr(sys, 'frozen', False),
|
||||
"Can't be run when frozen"),
|
||||
('frozen', not getattr(sys, 'frozen', False),
|
||||
"Can only run when frozen"),
|
||||
('skip', True, "Always skipped."),
|
||||
('pyqt531_or_newer', PYQT_VERSION < 0x050301,
|
||||
"Needs PyQt 5.3.1 or newer."),
|
||||
"Needs PyQt 5.3.1 or newer"),
|
||||
('ci', 'CI' not in os.environ, "Only runs on CI."),
|
||||
]
|
||||
|
||||
for searched_marker, condition, reason in markers:
|
||||
for searched_marker, condition, default_reason in markers:
|
||||
marker = item.get_marker(searched_marker)
|
||||
if not marker or not condition:
|
||||
continue
|
||||
|
||||
skipif_marker = pytest.mark.skipif(condition, reason=reason)
|
||||
if 'reason' in marker.kwargs:
|
||||
reason = '{}: {}'.format(default_reason, marker.kwargs['reason'])
|
||||
del marker.kwargs['reason']
|
||||
else:
|
||||
reason = default_reason + '.'
|
||||
skipif_marker = pytest.mark.skipif(condition, *marker.args,
|
||||
reason=reason, **marker.kwargs)
|
||||
item.add_marker(skipif_marker)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user