Skip to content

Commit ff083a1

Browse files
authored
tests: move test into correct test file and remove redundant test file (#869)
1 parent b2bee10 commit ff083a1

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

tests/masonry/builders/test_metadata.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/masonry/test_metadata.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,28 @@
1313
from pytest_mock import MockerFixture
1414

1515

16+
@pytest.mark.parametrize(
17+
("requires_python", "python", "expected"),
18+
[
19+
(">=3.8", None, ">=3.8"),
20+
(None, "^3.8", ">=3.8,<4.0"),
21+
(">=3.8", "^3.8", ">=3.8"),
22+
],
23+
)
24+
def test_from_package_requires_python(
25+
requires_python: str | None, python: str | None, expected: str
26+
) -> None:
27+
package = ProjectPackage("foo", "1")
28+
if requires_python:
29+
package.requires_python = requires_python
30+
if python:
31+
package.python_versions = python
32+
33+
meta = Metadata.from_package(package)
34+
35+
assert meta.requires_python == expected
36+
37+
1638
def test_from_package_readme(tmp_path: Path) -> None:
1739
readme_path = tmp_path / "README.md"
1840
readme_path.write_text("This is a description\néöß", encoding="utf-8")

0 commit comments

Comments
 (0)