pytest-sugar icon indicating copy to clipboard operation
pytest-sugar copied to clipboard

DeprecationWarning for LooseVersion usage

Open macintacos opened this issue 3 years ago • 3 comments

This is mostly just a "heads up", using this with Python 3.10, I'm getting a Deprecation warning that looks like the following:

/Users/juliant/Library/Caches/pypoetry/virtualenvs/ops-template-wDb_TPtP-py3.10/lib/python3.10/site-packages/pytest_sugar.py:168: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.version import LooseVersion

It's pretty noisy in my test output, hope it can be fixed.

macintacos avatar Dec 14 '21 05:12 macintacos

The way the issue can be fixed can be found here: https://github.com/marshmallow-code/marshmallow/commit/a63c28edde1e3f1f522aab8a7de231230786ebc1 (there was a similar problem).

decaz avatar Dec 20 '21 13:12 decaz

I'm looking for a workaround to disable this warning and wondering if anyone has done it?

This appears to only be related to warnings in the user code. I tried it anyways and didn't change output.

Other failed attempts:

  • pytest --verbose --disable-pytest-warnings
  • pytest --verbose --disable-warnings
  • pytest --verbose -W ignore:pytest_sugar:DeprecationWarning (probably same results as putting in pytest.ini)

Am I missing something or is this just not possible?

kbroch-rivosinc avatar Feb 18 '22 13:02 kbroch-rivosinc

Fixed by #230

Cielquan avatar Apr 05 '22 04:04 Cielquan