summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-06-29 22:07:46 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-10-04 08:15:42 -0400
commit9f6284eea50a56efe6125ff4b760e72cbc445244 (patch)
treee7629c552e5d1f3ea933618988acfbfa2e3f3326 /tests
parent231b38dcc68806e224323a98ad8a510885df712e (diff)
downloadpython-coveragepy-git-9f6284eea50a56efe6125ff4b760e72cbc445244.tar.gz
Suppress needless warnings during tests
(cherry picked from commit 9e783c683cf2013730a84c6f5e2e7f4439d7a352)
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index a0c21a84..a2de4d9e 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)