Skip to content

Commit

Permalink
Capture problems with similar names in editable install
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Aug 24, 2022
1 parent e551496 commit 753b195
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions setuptools/tests/test_editable_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,30 @@ def test_no_recursion(self, tmp_path):
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.
Expand Down

0 comments on commit 753b195

Please sign in to comment.