diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-08-24 09:32:51 +0100 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-08-24 09:32:51 +0100 |
commit | 753b195877ea35fbf3e9c06818a51cffeda48ea3 (patch) | |
tree | 5ec9b2a0c8ced2d48857ed1253239d24ded54fd5 | |
parent | e551496e9948a272b42f4a654d722500149380d2 (diff) | |
download | python-setuptools-git-753b195877ea35fbf3e9c06818a51cffeda48ea3.tar.gz |
Capture problems with similar names in editable install
-rw-r--r-- | setuptools/tests/test_editable_install.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/setuptools/tests/test_editable_install.py b/setuptools/tests/test_editable_install.py index 4a2ceb12..c8ee7477 100644 --- a/setuptools/tests/test_editable_install.py +++ b/setuptools/tests/test_editable_install.py @@ -515,6 +515,30 @@ class TestFinderTemplate: with pytest.raises(ImportError, match="pkg"): import_module("pkg") + def test_similar_name(self, tmp_path): + files = { + "foo": { + "__init__.py": "", + "bar": { + "__init__.py": "", + } + }, + } + jaraco.path.build(files, prefix=tmp_path) + + mapping = { + "foo": str(tmp_path / "foo"), + } + template = _finder_template(str(uuid4()), mapping, {}) + + with contexts.save_paths(), contexts.save_sys_modules(): + sys.modules.pop("foo", None) + sys.modules.pop("foo.bar", None) + + self.install_finder(template) + with pytest.raises(ImportError, match="foobar"): + import_module("foobar") + def test_pkg_roots(tmp_path): """This test focus in getting a particular implementation detail right. |