diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-06-29 22:07:46 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-06-29 22:07:46 -0400 |
commit | 9e783c683cf2013730a84c6f5e2e7f4439d7a352 (patch) | |
tree | 1f54d51a16912f4e048650c9ead49a5804e63909 /tests/conftest.py | |
parent | 0a4d90df6047c426c837e73c1d879b1c0addbb66 (diff) | |
download | python-coveragepy-git-9e783c683cf2013730a84c6f5e2e7f4439d7a352.tar.gz |
Suppress needless warnings during tests
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 4470b751..ecfeaf24 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,9 +10,23 @@ This module is run automatically by pytest, to define and enable fixtures. import pytest import warnings +from coverage import env + @pytest.fixture(autouse=True) def set_warnings(): """Enable DeprecationWarnings during all tests.""" warnings.simplefilter("default") warnings.simplefilter("once", DeprecationWarning) + + # A warning to suppress: + # setuptools/py33compat.py:54: DeprecationWarning: The value of convert_charrefs will become + # True in 3.5. You are encouraged to set the value explicitly. + # unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape) + warnings.filterwarnings( + "ignore", + category=DeprecationWarning, + message="The value of convert_charrefs will become True in 3.5.", + ) + if env.PYPY: + warnings.filterwarnings("ignore", r".*unclosed file", category=ResourceWarning) |