This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2021-04-14.11:06:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618398377.82.0.479453704615.issue43840@roundup.psfhosted.org>
In-reply-to
Content
test_distutils logs 3 DeprecationWarning warnings. They are emitted on purpose and related to PEP 632.

Does someone want to propose a fix for that?

"with self.assertWarns(DeprecationWarning):" or warnings_helper.check_warnings() of test.support.warnings_helper can be used.


$ ./python -m test -v test_distutils 
(...)
0:00:00 load avg: 5.49 [1/1] test_distutils
/home/vstinner/python/master/Lib/test/test_distutils.py:8: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.tests

(...)

test_byte_compile_optimized (distutils.tests.test_build_py.BuildPyTestCase) ... /tmp/tmpptdx9r50.py:1: 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.util import byte_compile
ok

(...)

test_byte_compile (distutils.tests.test_install_lib.InstallLibTestCase) ... /tmp/tmpk_cfc09q.py:1: 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.util import byte_compile
ok

(...)

Tests result: SUCCESS

--

By the way, it would be nice to ignore the DeprecationWarning in setup.py as well for now:

$ make
(...)
/home/vstinner/python/master/./setup.py:33: 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 import log
(...)

This warning is annoying.
History
Date User Action Args
2021-04-14 11:06:17vstinnersetrecipients: + vstinner
2021-04-14 11:06:17vstinnersetmessageid: <1618398377.82.0.479453704615.issue43840@roundup.psfhosted.org>
2021-04-14 11:06:17vstinnerlinkissue43840 messages
2021-04-14 11:06:17vstinnercreate