Skip to content

Commit 7bdcc3f

Browse files
committed
Add test for duplicate package already seen
1 parent 35e8f3c commit 7bdcc3f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_pyproject_dependencies.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@ def test_basic(tmp_path: Path) -> None:
7676
assert result.stdout == "d1\nd2\nd3\n"
7777

7878

79+
def test_already_seen(tmp_path: Path) -> None:
80+
_make_project(tmp_path, name="p_1", deps=["d1", "d2"])
81+
duplicate_path = tmp_path / "dup"
82+
duplicate_path.mkdir()
83+
_make_project(duplicate_path, name="P_1", deps=["d1", "d3", "p1"])
84+
result = subprocess.run(
85+
[
86+
sys.executable,
87+
"-m",
88+
"pyproject_dependencies",
89+
str(tmp_path / "p_1"),
90+
str(duplicate_path / "P_1" / "pyproject.toml"),
91+
],
92+
check=True,
93+
text=True,
94+
capture_output=True,
95+
)
96+
assert result.stdout == "d1\nd2\n"
97+
assert "p-1 already seen" in result.stderr
98+
99+
79100
def test_basic_legacy(tmp_path: Path) -> None:
80101
_make_legacy_project(tmp_path, name="p1", deps=["d1", "d2"])
81102
_make_legacy_project(tmp_path, name="p2", deps=["d1", "d3", "p1"])

0 commit comments

Comments
 (0)