-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
type: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelogmight present some backward compatibility issues which should be carefully noted in the changelogtype: deprecationfeature that will be removed in the futurefeature that will be removed in the futuretype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch
Description
The signature of pytest.skip
is:
skip(msg[, allow_module_level=False])
but the signature of pytest.xfail
is:
xfail(reason='')
Marks (pytest.mark.skip, pytest.mark.skipif and pytest.mark.xfail) use reason
too:
pytest.mark.skipif(condition, *, reason=None)
pytest.mark.xfail(condition=None, *, reason=None, raises=None, run=True, strict=False)¶
pytest.mark.skipif(condition, *, reason=None)¶
Note that pytest.fail
uses msg
:
fail(msg='', pytrace=True)
but at least from an user perspective, skip
is probably closer to xfail
and mark.skip
/ mark.skipif
/ mark.xfail
.
Should we rename the msg
argument for pytest.skip
to reason
for consistency (with a deprecation for the old name), or isn't that worth the trouble?
Thanks to Francesco Casalegno for reporting this in the pytest training I gave at Europython 2021 today!
Metadata
Metadata
Assignees
Labels
type: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelogmight present some backward compatibility issues which should be carefully noted in the changelogtype: deprecationfeature that will be removed in the futurefeature that will be removed in the futuretype: enhancementnew feature or API change, should be merged into features branchnew feature or API change, should be merged into features branch