summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-12-31 08:51:58 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-12-31 15:26:02 +0100
commit9a6afd3e010ba747472f8c8c9a5d2be32909f98b (patch)
treef015f66d4a9c22a4074884382747e8339ec6f810
parent956af8ab7c3157cc26ab2ed05f9c1b604781d4b8 (diff)
downloadpylint-git-regression-tests-for-73.tar.gz
Add a regression test for pylint #73regression-tests-for-73
Following change in the way distutil is stored in setuptools See https://github.com/PyCQA/astroid/pull/1321
-rw-r--r--tests/functional/r/regression_02/regression_distutil_import_error_73.py15
-rw-r--r--tests/functional/r/regression_02/regression_distutil_import_error_73.txt3
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/functional/r/regression_02/regression_distutil_import_error_73.py b/tests/functional/r/regression_02/regression_distutil_import_error_73.py
new file mode 100644
index 000000000..751a4980f
--- /dev/null
+++ b/tests/functional/r/regression_02/regression_distutil_import_error_73.py
@@ -0,0 +1,15 @@
+"""
+Regression test to check that distutils can be imported
+See https://github.com/PyCQA/pylint/issues/73
+
+See also:
+https://github.com/PyCQA/pylint/issues/2955
+https://github.com/PyCQA/astroid/pull/1321
+"""
+
+# pylint: disable=unused-import
+
+import distutils.version
+from distutils.util import strtobool
+from distutils import doesnottexists # [no-name-in-module]
+from distutils.doesnottexists import nope # [no-name-in-module, import-error]
diff --git a/tests/functional/r/regression_02/regression_distutil_import_error_73.txt b/tests/functional/r/regression_02/regression_distutil_import_error_73.txt
new file mode 100644
index 000000000..85177f190
--- /dev/null
+++ b/tests/functional/r/regression_02/regression_distutil_import_error_73.txt
@@ -0,0 +1,3 @@
+no-name-in-module:14:0:14:36::No name 'doesnottexists' in module 'distutils':UNDEFINED
+import-error:15:0:15:41::Unable to import 'distutils.doesnottexists':UNDEFINED
+no-name-in-module:15:0:15:41::No name 'doesnottexists' in module 'distutils':UNDEFINED