diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-01-09 08:27:11 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-01-10 09:46:18 -0500 |
commit | 474847081a11b0f643df5950f4763ac29a1524b0 (patch) | |
tree | 943e1f295b26ba7fcf64d836ca0941b905398b17 /tests/conftest.py | |
parent | f08d8a8a1d6f852a9bc04a950ec9f9facaf92f5e (diff) | |
download | python-coveragepy-git-474847081a11b0f643df5950f4763ac29a1524b0.tar.gz |
Use the modern way to load modules by file name.
Python 3.10 finally got super-noisy about load_module, which has been
deprecated since 3.4!
https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 82a6b0f2..10761cdd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,21 +25,32 @@ def set_warnings(): warnings.simplefilter("default") warnings.simplefilter("once", DeprecationWarning) - # A warning to suppress: + # Warnings to suppress: + # How come these warnings are successfully suppressed here, but not in setup.cfg?? + # 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) - # How come this warning is successfully suppressed here, but not in setup.cfg?? warnings.filterwarnings( "ignore", category=DeprecationWarning, - message="The value of convert_charrefs will become True in 3.5.", + message=r"The value of convert_charrefs will become True in 3.5.", ) + warnings.filterwarnings( "ignore", category=DeprecationWarning, - message=".* instead of inspect.getfullargspec", + message=r".* instead of inspect.getfullargspec", ) + + # <frozen importlib._bootstrap>:681: + # ImportWarning: VendorImporter.exec_module() not found; falling back to load_module() + warnings.filterwarnings( + "ignore", + category=ImportWarning, + message=r".*exec_module\(\) not found; falling back to load_module\(\)", + ) + if env.PYPY3: # pypy3 warns about unclosed files a lot. warnings.filterwarnings("ignore", r".*unclosed file", category=ResourceWarning) |