tests: drop test-demandimport.py distutils test that failed with warnings
The test would fail because warnings:
/usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
/usr/lib/python3.11/site-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
The test for distutils.msvc9compiler comes from
2205d00b6d2b. But since then,
distutils is going away, and this test must change somehow. It is unclear exactly
how setuptools depended on msvc9compiler, but setuptools also moved forward,
and this exact test no longer seems relevant. It thus seems like a fair
solution to remove the test while keeping the demandimport blacklist of
distutils.msvc9compiler.
--- a/tests/test-demandimport.py Thu Jun 29 20:02:27 2023 +0200
+++ b/tests/test-demandimport.py Mon Jun 26 15:16:51 2023 +0200
@@ -31,18 +31,6 @@
except ImportError:
moduletype = types.ModuleType
-if os.name != 'nt':
- try:
- import distutils.msvc9compiler
-
- print(
- 'distutils.msvc9compiler needs to be an immediate '
- 'importerror on non-windows platforms'
- )
- distutils.msvc9compiler
- except ImportError:
- pass
-
import re
rsub = re.sub