diff options
author | Bruno Oliveira <nicoddemus@gmail.com> | 2019-12-03 19:49:20 -0300 |
---|---|---|
committer | Bruno Oliveira <bruno@esss.com.br> | 2019-12-04 15:30:45 -0300 |
commit | c7f9fda42d475a5579aa988d8b491be3de53925b (patch) | |
tree | c1897c2b986c392804dac7d132e3109fe9ac3aff /testing/test_config.py | |
parent | 42fb1f7ede3d762ecc9e4b75b13a740d41416dda (diff) | |
download | pytest-c7f9fda42d475a5579aa988d8b491be3de53925b.tar.gz |
Fix assertion rewriting module detection for egg dists
Fix #6301
Diffstat (limited to 'testing/test_config.py')
-rw-r--r-- | testing/test_config.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/testing/test_config.py b/testing/test_config.py index f146b52a4..9735fc176 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -422,15 +422,21 @@ class TestConfigAPI: @pytest.mark.parametrize( "names, expected", [ + # dist-info based distributions root are files as will be put in PYTHONPATH (["bar.py"], ["bar"]), - (["foo", "bar.py"], []), - (["foo", "bar.pyc"], []), - (["foo", "__init__.py"], ["foo"]), - (["foo", "bar", "__init__.py"], []), + (["foo/bar.py"], ["bar"]), + (["foo/bar.pyc"], []), + (["foo/__init__.py"], ["foo"]), + (["bar/__init__.py", "xz.py"], ["bar", "xz"]), + (["setup.py"], []), + # egg based distributions root contain the files from the dist root + (["src/bar/__init__.py"], ["bar"]), + (["src/bar/__init__.py", "setup.py"], ["bar"]), + (["source/python/bar/__init__.py", "setup.py"], ["bar"]), ], ) def test_iter_rewritable_modules(self, names, expected): - assert list(_iter_rewritable_modules(["/".join(names)])) == expected + assert list(_iter_rewritable_modules(names)) == expected class TestConfigFromdictargs: |