Skip to content

Commit 868c50e

Browse files
committed
Add test for unmatch license-files pattern
1 parent d0a55a0 commit 868c50e

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
@@ -461,6 +461,14 @@ def test_default_patterns(self, tmp_path):
461461
assert (tmp_path / "LICENSE.txt").exists() # from base example
462462
assert set(dist.metadata.license_files) == {*license_files, "LICENSE.txt"}
463463

464+
def test_missing_patterns(self, tmp_path):
465+
pyproject = self.base_pyproject_license_pep639(tmp_path)
466+
assert list(tmp_path.glob("_FILE*")) == [] # sanity check
467+
468+
msg = "Cannot find any license files for the given patterns."
469+
with pytest.warns(SetuptoolsDeprecationWarning, match=msg):
470+
pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject)
471+
464472
def test_deprecated_file_expands_to_text(self, tmp_path):
465473
"""Make sure the old example with ``license = {text = ...}`` works"""
466474

0 commit comments

Comments
 (0)