Skip to content

Commit ab0e5cf

Browse files
committed
Add test for unmatch license-files pattern
1 parent 63f64b2 commit ab0e5cf

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

setuptools/tests/config/test_apply_pyprojecttoml.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,14 @@ def test_default_patterns(self, tmp_path):
448448
assert (tmp_path / "LICENSE.txt").exists() # from base example
449449
assert set(dist.metadata.license_files) == {*license_files, "LICENSE.txt"}
450450

451+
def test_missing_patterns(self, tmp_path):
452+
pyproject = self.base_pyproject_license_pep639(tmp_path)
453+
assert list(tmp_path.glob("_FILE*")) == [] # sanity check
454+
455+
msg = "Cannot find any license files for the given patterns."
456+
with pytest.warns(SetuptoolsDeprecationWarning, match=msg):
457+
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
458+
451459

452460
class TestPyModules:
453461
# https://github.com/pypa/setuptools/issues/4316

0 commit comments

Comments
 (0)