summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2022-01-09 01:07:08 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2022-01-09 01:07:08 +0000
commitd8af8adcf8db17a76284e245b6bc34c41098d913 (patch)
tree197e9d86e220b0d06b5893c4a62a4e12f9cbd776
parent464568d64469fb1ca9794ef26fe2288f16c15598 (diff)
downloadpython-setuptools-git-d8af8adcf8db17a76284e245b6bc34c41098d913.tar.gz
Prevent test files from being included in setuptools own wheel
-rw-r--r--setup.cfg1
-rw-r--r--setuptools/tests/test_setuptools.py9
2 files changed, 10 insertions, 0 deletions
diff --git a/setup.cfg b/setup.cfg
index e91d8aed..a276254a 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -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