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 dstufft, eric.araujo, vstinner
Date 2020-03-24.16:51:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Even when no test is run, test_distutils alters the environment:

$ ./python -m test -v --fail-env-changed test_distutils -m DONTEXISTS
== CPython 3.7.7+ (heads/3.7:1cdc61c767, Mar 24 2020, 17:25:30) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
== Linux-5.5.9-200.fc31.x86_64-x86_64-with-fedora-31-Thirty_One little-endian
== cwd: /home/vstinner/python/3.7/build/test_python_157151
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
0:00:00 load avg: 0.37 Run tests sequentially
0:00:00 load avg: 0.37 [1/1] test_distutils


Ran 0 tests in 0.001s

Warning -- warnings.filters was modified by test_distutils
  Before: (140048876788832, [], [])
  After:  (140048876788832, [], [('ignore', None, <class 'pkg_resources.PEP440Warning'>, None, 0)]) 
test_distutils run no tests

== Tests result: NO TEST RUN ==

1 test run no tests:

Total duration: 655 ms
Tests result: NO TEST RUN

The problem comes from Lib/distutils/tests/ "from distutils.command.check import check, HAS_DOCUTILS" imports indirectly the docutils module which imports pkg_resources.

pkg_resources changes warnings filters.

docutils is installed by python3-docutils-0.15.2-1.fc31.noarch package and pkg_resources comes from python3-setuptools-41.6.0-1.fc31.noarch package.

Attached PR disables docutils to avoid side effects of "import docutils" like pkg_resources modifying warnings filters.
Date User Action Args
2020-03-24 16:51:30vstinnersetrecipients: + vstinner, eric.araujo, dstufft
2020-03-24 16:51:30vstinnersetmessageid: <>
2020-03-24 16:51:30vstinnerlinkissue40055 messages
2020-03-24 16:51:30vstinnercreate