mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fail hard when tests pass that are expected to fail
`@pytest.mark.xfail()` can be used to decorate tests that don't yet pass. By default, if I wrote a test like this: ``` @pytest.mark.xfail() def test_naughty(): assert 1 == 1 ``` Then Pytest would allow this test to pass without notifying that an expected-fail *didn't* fail. To make that happen, you have to set xfail_strict=True so that the above test would cause the tests to fail.
This commit is contained in:
parent
cc6331f155
commit
ae5c370737
1 changed files with 2 additions and 0 deletions
2
tox.ini
2
tox.ini
|
@ -20,6 +20,8 @@ passenv =
|
|||
# variable error. See issue: #20424
|
||||
HOME
|
||||
|
||||
[pytest]
|
||||
xfail_strict = true
|
||||
|
||||
[flake8]
|
||||
# These are things that the devs don't agree make the code more readable
|
||||
|
|
Loading…
Reference in a new issue