Skip to content

Commit

Permalink
Treat XPASS status as a test failure
Browse files Browse the repository at this point in the history
This causes full "failure" output to be printed when a test marked
xfail unexpectedly passes, and for the test run to be considered
failing as a result.

The immediate purpose of this change is to facilitate efficient
identification of recently introduced wrong or overbroad xfail
markings.

This behavior may eventually become the pytest default (see gitpython-developers#1728
and references therein), and this could be retained even after the
current xpassing tests are investigated, to facilitate timely
detection of tests marked xfail of code that is newly working.

(Individual tests decorated `@pytest.mark.xfail` can still be
allowed to unexpectedly pass without it being treated like a test
failure, by passing strict=False explicitly.)
  • Loading branch information
EliahKagan committed Nov 25, 2023
1 parent 2875ffa commit 0f8cd4c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ filterwarnings = "ignore::DeprecationWarning"
python_files = "test_*.py"
tmp_path_retention_policy = "failed"
testpaths = "test" # Space separated list of paths from root e.g test tests doc/testing.
xfail_strict = true # Treat the XPASS status as a test failure (unless strict=False is passed).
# --cov coverage
# --cov-report term # send report to terminal term-missing -> terminal with line numbers html xml
# --cov-report term-missing # to terminal with line numbers
Expand Down

0 comments on commit 0f8cd4c

Please sign in to comment.