DeprecationWarning when used with pytest
See original GitHub issueDescribe the bug
Using pyfakefs with pytest produces a deprecation warning about the compiler package as soon as a test depends on the fs fixture.
plugins: pyfakefs-3.5.6
collected 1 item
tests/test_foo.py . [100%]
================================================= warnings summary ==================================================
tests/test_foo.py::test_fs
/usr/local/miniconda3/envs/alpenhorn/lib/python2.7/site-packages/py/_code/_assertionold.py:3: DeprecationWarning: The compiler package is deprecated and removed in Python 3.x.
from compiler import parse, ast, pycodegen
-- Docs: https://docs.pytest.org/en/latest/warnings.html
======================================= 1 passed, 1 warnings in 0.11 seconds ========================================
How To Reproduce Put the following into test_foo.py:
def test_foo(fs):
pass
Then run pytest test_foo.py.
Your enviroment Please run the following and paste the output.
Darwin-18.0.0-x86_64-i386-64bit
('Python', '2.7.15 |Anaconda, Inc.| (default, Dec 14 2018, 13:10:39) \n[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]')
('pyfakefs', '3.5.6')
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Deprecations and Removals — pytest documentation
The objective is to give users a clear rationale why a certain feature has been removed, and what alternatives should be used instead....
Read more >How to suppress py.test internal deprecation warnings
Disabling all warnings persistently (i.e. using pytest.ini) is almost never a good idea. Disabling just Deprecation warning (and by module) as ...
Read more >DeprecationWarning when used with pytest #466 - GitHub
Describe the bug Using pyfakefs with pytest produces a deprecation warning about the compiler package as soon as a test depends on the...
Read more >Suppress Warnings in pytest | SukhbinderSingh.com
Recently had this issue with pytest. ... DeprecationWarning: i nspect.getargspec() is deprecated, use inspect.signature()…
Read more >DeprecationWarning about distutils running pytest tests
plugins/python/helpers/pycharm/_jb_pytest_runner.py:6: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@diefans - thanks for that - this works nicely! I obviously had put the filter into the wrong place. And we can make this very specific to suppress only this one warning…
When I put
catch_warningscontext aroundmodules = ...I do not get deprecation warnings in python 2.7…