Skip to content

Commit

Permalink
MAINT: Ignore pytest's PytestConfigWarning
Browse files Browse the repository at this point in the history
When pytest is run with python optimization set by the environment variable
PYTHONOPTIMIZE=2, it generates the warning

    pytest.PytestConfigWarning: assertions not in test modules or plugins
    will be ignored because assert statements are not executed by the
    underlying Python interpreter (are you using python -O?)

Apparently this warning causes the test suite to fail.  In this change,
I've added

    ignore:assertions not in test modules or plugins:pytest.PytestConfigWarning

to the filter warnings used by pytest, so the PytestConfigWarning is
ignored.
  • Loading branch information
WarrenWeckesser authored and peterbell10 committed Oct 4, 2020
1 parent bf230f8 commit 02563b2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ filterwarnings =
ignore:can't resolve package from __spec__ or __package__, falling back on __name__ and __path__:ImportWarning
once:the imp module is deprecated in favour of importlib.*:DeprecationWarning
once:the imp module is deprecated in favour of importlib.*:PendingDeprecationWarning
ignore:assertions not in test modules or plugins:pytest.PytestConfigWarning

0 comments on commit 02563b2

Please sign in to comment.