Skip to content

Commit ba7dc9e

Browse files
committed
Add test for dynamic readme from setup.py args
1 parent dad9161 commit ba7dc9e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

setuptools/tests/config/test_pyprojecttoml.py

+14
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,20 @@ def test_dynamic_without_config(self, tmp_path):
253253
with pytest.raises(OptionError, match="No configuration .* .classifiers."):
254254
read_configuration(pyproject)
255255

256+
def test_dynamic_readme_from_setup_script_args(self, tmp_path):
257+
config = """
258+
[project]
259+
name = "myproj"
260+
version = '42'
261+
dynamic = ["readme"]
262+
"""
263+
pyproject = tmp_path / "pyproject.toml"
264+
pyproject.write_text(cleandoc(config))
265+
dist = Distribution(attrs={"long_description": "42"})
266+
# No error should occur because of missing `readme`
267+
dist = apply_configuration(dist, pyproject)
268+
assert dist.metadata.long_description == "42"
269+
256270
def test_dynamic_without_file(self, tmp_path):
257271
config = """
258272
[project]

0 commit comments

Comments
 (0)