Skip to content

Commit 9b77463

Browse files
committed
Test against false positve matches
1 parent 16c6f72 commit 9b77463

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

setuptools/tests/test_sdist.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,19 @@ def test_defaults_case_sensitivity(self, source_dir):
429429
def test_exclude_dev_only_cache_folders(self, source_dir):
430430
included = {
431431
# Emulate problem in https://github.com/pypa/setuptools/issues/4601
432-
"MANIFEST.in": "global-include LICEN[CS]E* COPYING* NOTICE* AUTHORS*",
432+
"MANIFEST.in": (
433+
"global-include LICEN[CS]E* COPYING* NOTICE* AUTHORS*\n"
434+
"global-include *.txt\n"
435+
),
433436
# For the sake of being conservative and limiting unforeseen side-effects
434-
# we just exclude dev-only cache folders at the root of the repository
437+
# we just exclude dev-only cache folders at the root of the repository:
435438
"test/.venv/lib/python3.9/site-packages/bar-2.dist-info/AUTHORS.rst": "",
436439
"src/.nox/py/lib/python3.12/site-packages/bar-2.dist-info/COPYING.txt": "",
437440
"doc/.tox/default/lib/python3.11/site-packages/foo-4.dist-info/LICENSE": "",
441+
# Let's test against false positives with similarly named files:
442+
".venv-requirements.txt": "",
443+
".tox-coveragerc.txt": "",
444+
".noxy/coveragerc.txt": "",
438445
}
439446

440447
excluded = {
@@ -454,10 +461,10 @@ def test_exclude_dev_only_cache_folders(self, source_dir):
454461
manifest = cmd.filelist.files
455462
for path in excluded:
456463
assert os.path.exists(path)
457-
assert path not in manifest
464+
assert path not in manifest, (path, manifest)
458465
for path in included:
459466
assert os.path.exists(path)
460-
assert path in manifest
467+
assert path in manifest, (path, manifest)
461468

462469
@fail_on_ascii
463470
def test_manifest_is_written_with_utf8_encoding(self):

0 commit comments

Comments
 (0)