summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-21 06:27:30 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-08-21 06:27:30 +0100
commit54a8656ecbdfaaaf47f8b12260d8779632e370e1 (patch)
tree04fcc29955728d4e2c35fd9585df2a4079b240ee /setuptools/tests
parentfeed34f981cd7035d787e1cb4825ea58a423152d (diff)
downloadpython-setuptools-git-54a8656ecbdfaaaf47f8b12260d8779632e370e1.tar.gz
Capture recursion problem with editable finder
First mentioned in issue 3550.
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_editable_install.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/setuptools/tests/test_editable_install.py b/setuptools/tests/test_editable_install.py
index 6b5cdd1c..ff65df9b 100644
--- a/setuptools/tests/test_editable_install.py
+++ b/setuptools/tests/test_editable_install.py
@@ -494,6 +494,26 @@ class TestFinderTemplate:
three = import_module("parent.child.three")
assert three.x == 3
+ def test_no_recursion(self, tmp_path):
+ files = {
+ "pkg": {
+ "__init__.py": "from . import pkg",
+ },
+ }
+ jaraco.path.build(files, prefix=tmp_path)
+
+ mapping = {
+ "pkg": str(tmp_path / "pkg"),
+ }
+ template = _finder_template(str(uuid4()), mapping, {})
+
+ with contexts.save_paths(), contexts.save_sys_modules():
+ sys.modules.pop("pkg", None)
+
+ self.install_finder(template)
+ with pytest.raises(ModuleNotFoundError, match="No module named 'pkg.pkg'"):
+ import_module("pkg")
+
def test_pkg_roots(tmp_path):
"""This test focus in getting a particular implementation detail right.