Skip to content

Commit 3cb4ee6

Browse files
committed
Clean up Poetry environments at end of new_cookie fixture
1 parent f6bdc98 commit 3cb4ee6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import os
3+
import subprocess
34
import sys
45
from pathlib import Path
56
from tempfile import TemporaryDirectory
@@ -86,4 +87,7 @@ def new_cookie(
8687
]
8788
with patch.object(sys, "argv", testargs):
8889
new_cookie_main()
89-
yield temp_dir / PROJECT_NAME
90+
project_dir = temp_dir / PROJECT_NAME
91+
yield project_dir
92+
if (project_dir / "pyproject.toml").is_file():
93+
subprocess.run(["poetry", "env", "remove", "--all"], cwd=project_dir)

0 commit comments

Comments
 (0)