diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2020-04-24 22:34:10 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2020-04-24 22:39:54 +0700 |
commit | d11428b1cc059ff6aa0ddec0bd8354a1df68d752 (patch) | |
tree | e5d7a2d4b3c09934f749f6cea8336513a177507b /pkg_resources/tests/test_pkg_resources.py | |
parent | 92ca9eab30e1aececf4243d9a928cfe63f7dcfc9 (diff) | |
download | python-setuptools-git-d11428b1cc059ff6aa0ddec0bd8354a1df68d752.tar.gz |
Stop recognizing files ending with .dist-info as dist
As proposed in PEP 376, dist-info distributions must be directories.
Diffstat (limited to 'pkg_resources/tests/test_pkg_resources.py')
-rw-r--r-- | pkg_resources/tests/test_pkg_resources.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg_resources/tests/test_pkg_resources.py b/pkg_resources/tests/test_pkg_resources.py index 78281869..1c66dec0 100644 --- a/pkg_resources/tests/test_pkg_resources.py +++ b/pkg_resources/tests/test_pkg_resources.py @@ -330,6 +330,14 @@ def test_distribution_version_missing_undetected_path(): assert msg == expected +@pytest.mark.parametrize('only', [False, True]) +def test_dist_info_is_not_dir(tmp_path, only): + """Test path containing a file with dist-info extension.""" + dist_info = tmp_path / 'foobar.dist-info' + dist_info.touch() + assert not pkg_resources.dist_factory(str(dist_info), only) + + class TestDeepVersionLookupDistutils: @pytest.fixture def env(self, tmpdir): |