Suppressing DeprecationWarning does not always work

Viewed 131

I get the same DeprecationWarning in many contexts, e.g. when running pytest or in a Flask server:

+ pytest -s -W ignore::DeprecationWarning
========================================== test session starts ===========================================
platform linux -- Python 3.8.1, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /home/user/projects/myproject
plugins: dash-1.9.1
collected 39 items                                                                                       

tests/test_cache.py ......
[...]

============================================ warnings summary ============================================
/home/user/projects/myproject/venv/lib/python3.8/site-packages/past/builtins/misc.py:45
  /home/user/projects/myproject/venv/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning:

  the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

-- Docs: https://docs.pytest.org/en/latest/warnings.html
===================================== 39 passed, 1 warning in 16.64s =====================================

What's the reason and how can I suppress this thing?

0 Answers
Related