diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-01-09 01:07:08 +0000 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-01-09 01:07:08 +0000 |
commit | d8af8adcf8db17a76284e245b6bc34c41098d913 (patch) | |
tree | 197e9d86e220b0d06b5893c4a62a4e12f9cbd776 | |
parent | 464568d64469fb1ca9794ef26fe2288f16c15598 (diff) | |
download | python-setuptools-git-d8af8adcf8db17a76284e245b6bc34c41098d913.tar.gz |
Prevent test files from being included in setuptools own wheel
-rw-r--r-- | setup.cfg | 1 | ||||
-rw-r--r-- | setuptools/tests/test_setuptools.py | 9 |
2 files changed, 10 insertions, 0 deletions
@@ -34,6 +34,7 @@ exclude = docs* tests* *.tests + *.tests.* tools* [options.extras_require] diff --git a/setuptools/tests/test_setuptools.py b/setuptools/tests/test_setuptools.py index 3c429263..b97faf17 100644 --- a/setuptools/tests/test_setuptools.py +++ b/setuptools/tests/test_setuptools.py @@ -7,6 +7,7 @@ import distutils.cmd from distutils.errors import DistutilsOptionError from distutils.errors import DistutilsSetupError from distutils.core import Extension +from zipfile import ZipFile import pytest @@ -294,3 +295,11 @@ def test_findall_missing_symlink(tmpdir, can_symlink): os.symlink('foo', 'bar') found = list(setuptools.findall()) assert found == [] + + +def test_its_own_wheel_does_not_contain_tests(setuptools_wheel): + with ZipFile(setuptools_wheel) as zipfile: + contents = [f.replace(os.sep, '/') for f in zipfile.namelist()] + + for member in contents: + assert '/tests/' not in member |