diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-05-09 09:05:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-09 09:05:56 +0200 |
commit | f020b2f07361fa2b577bc07c4a68309905bd46ae (patch) | |
tree | a1d1880451fac270df94ce861677e736b2c9163c /tests | |
parent | 40ddfabcb0afe5dadab3c4dcd890b8302db9edd0 (diff) | |
download | pylint-git-f020b2f07361fa2b577bc07c4a68309905bd46ae.tar.gz |
Revert "Do not append namespace packages to sys.path (#6405)" (#6548)
This reverts commit 603be8408a5d2d98283f41cfd9a94998fd7cfd3c.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lint/test_namespace_packages.py | 25 | ||||
-rw-r--r-- | tests/lint/unittest_expand_modules.py | 8 | ||||
-rw-r--r-- | tests/regrtest_data/namespace_import_self/else/__init__.py | 0 | ||||
-rw-r--r-- | tests/regrtest_data/namespace_import_self/pylint/__init__.py | 5 |
4 files changed, 0 insertions, 38 deletions
diff --git a/tests/lint/test_namespace_packages.py b/tests/lint/test_namespace_packages.py deleted file mode 100644 index 6ac96f09e..000000000 --- a/tests/lint/test_namespace_packages.py +++ /dev/null @@ -1,25 +0,0 @@ -# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html -# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE -# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt - -"""Tests related to linting of namespace packages.""" - -from io import StringIO - -from pylint.reporters.text import TextReporter -from pylint.testutils._run import _Run as Run - - -def test_namespace_package_sys_path() -> None: - """Test that we do not append namespace packages to sys.path. - - The test package is based on https://github.com/PyCQA/pylint/issues/2648. - """ - pylint_output = StringIO() - reporter = TextReporter(pylint_output) - runner = Run( - ["tests/regrtest_data/namespace_import_self/"], - reporter=reporter, - exit=False, - ) - assert not runner.linter.stats.by_msg diff --git a/tests/lint/unittest_expand_modules.py b/tests/lint/unittest_expand_modules.py index 1ce5b6c4e..15f72d0c5 100644 --- a/tests/lint/unittest_expand_modules.py +++ b/tests/lint/unittest_expand_modules.py @@ -77,13 +77,6 @@ test_caching = { "path": str(TEST_DIRECTORY / "lint/test_caching.py"), } -test_namespace_packages = { - "basename": "lint", - "basepath": INIT_PATH, - "isarg": False, - "name": "lint.test_namespace_packages", - "path": str(TEST_DIRECTORY / "lint/test_namespace_packages.py"), -} init_of_package = { "basename": "lint", @@ -115,7 +108,6 @@ class TestExpandModules(CheckerTestCase): [ init_of_package, test_caching, - test_namespace_packages, test_pylinter, test_utils, this_file_from_init, diff --git a/tests/regrtest_data/namespace_import_self/else/__init__.py b/tests/regrtest_data/namespace_import_self/else/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/tests/regrtest_data/namespace_import_self/else/__init__.py +++ /dev/null diff --git a/tests/regrtest_data/namespace_import_self/pylint/__init__.py b/tests/regrtest_data/namespace_import_self/pylint/__init__.py deleted file mode 100644 index cce5e5302..000000000 --- a/tests/regrtest_data/namespace_import_self/pylint/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Module that imports from its own namespace.""" - -from pylint import run_pylint - -run_pylint() |