mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
make sure we return a mark decorator
This commit is contained in:
parent
a3a69c8385
commit
c94f66ad13
|
@ -13,6 +13,11 @@ def pytest_report_header(config):
|
|||
|
||||
|
||||
def pytest_configure(config):
|
||||
config.addinivalue_line(
|
||||
"markers",
|
||||
"pil_noop_mark: A conditional mark where nothing special happens",
|
||||
)
|
||||
|
||||
# We're marking some tests to ignore valgrind errors and XFAIL them.
|
||||
# Ensure that the mark is defined
|
||||
# even in cases where pytest-valgrind isn't installed
|
||||
|
|
|
@ -175,12 +175,15 @@ def skip_unless_feature_version(feature, version_required, reason=None):
|
|||
|
||||
def mark_if_feature_version(mark, feature, version_blacklist, reason=None):
|
||||
if not features.check(feature):
|
||||
return
|
||||
return pytest.mark.pil_noop_mark()
|
||||
if reason is None:
|
||||
reason = f"{feature} is {version_blacklist}"
|
||||
version_required = parse_version(version_blacklist)
|
||||
version_available = parse_version(features.version(feature))
|
||||
return mark(version_available == version_blacklist, reason=reason)
|
||||
if (version_available.major == version_required.major and
|
||||
version_available.minor == version_required.minor):
|
||||
return mark(reason=reason)
|
||||
return pytest.mark.pil_noop_mark()
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform.startswith("win32"), reason="Requires Unix or macOS")
|
||||
|
|
Loading…
Reference in New Issue
Block a user