From 9a6afd3e010ba747472f8c8c9a5d2be32909f98b Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Fri, 31 Dec 2021 08:51:58 +0100 Subject: Add a regression test for pylint #73 Following change in the way distutil is stored in setuptools See https://github.com/PyCQA/astroid/pull/1321 --- .../regression_02/regression_distutil_import_error_73.py | 15 +++++++++++++++ .../regression_02/regression_distutil_import_error_73.txt | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 tests/functional/r/regression_02/regression_distutil_import_error_73.py create mode 100644 tests/functional/r/regression_02/regression_distutil_import_error_73.txt 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 -- cgit v1.2.1