diff options
Diffstat (limited to 'pkg_resources/tests')
-rw-r--r-- | pkg_resources/tests/data/my-test-package-zip/my-test-package.zip | bin | 0 -> 1809 bytes | |||
-rw-r--r-- | pkg_resources/tests/test_find_distributions.py | 9 | ||||
-rw-r--r-- | pkg_resources/tests/test_resources.py | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/pkg_resources/tests/data/my-test-package-zip/my-test-package.zip b/pkg_resources/tests/data/my-test-package-zip/my-test-package.zip Binary files differnew file mode 100644 index 00000000..81f9a017 --- /dev/null +++ b/pkg_resources/tests/data/my-test-package-zip/my-test-package.zip diff --git a/pkg_resources/tests/test_find_distributions.py b/pkg_resources/tests/test_find_distributions.py index f9594422..b01b4827 100644 --- a/pkg_resources/tests/test_find_distributions.py +++ b/pkg_resources/tests/test_find_distributions.py @@ -32,3 +32,12 @@ class TestFindDistributions: assert [dist.project_name for dist in dists] == ['my-test-package'] dists = pkg_resources.find_distributions(str(target_dir), only=True) assert not list(dists) + + def test_zipped_sdist_one_level_removed(self, target_dir): + (TESTS_DATA_DIR / 'my-test-package-zip').copy(target_dir) + dists = pkg_resources.find_distributions( + str(target_dir / "my-test-package.zip")) + assert [dist.project_name for dist in dists] == ['my-test-package'] + dists = pkg_resources.find_distributions( + str(target_dir / "my-test-package.zip"), only=True) + assert not list(dists) diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index b08bb293..965a7c00 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -773,7 +773,7 @@ class TestNamespaces: ns_str = "__import__('pkg_resources').declare_namespace(__name__)\n" - @pytest.yield_fixture + @pytest.fixture def symlinked_tmpdir(self, tmpdir): """ Where available, return the tempdir as a symlink, @@ -791,7 +791,7 @@ class TestNamespaces: finally: os.unlink(link_name) - @pytest.yield_fixture(autouse=True) + @pytest.fixture(autouse=True) def patched_path(self, tmpdir): """ Patch sys.path to include the 'site-pkgs' dir. Also |