Skip to content

Commit bf036f4

Browse files
committed
Refactor editable tests
1 parent 29a5c11 commit bf036f4

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

spin/tests/test_build_cmds.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,6 @@ def test_run_stdout():
4848
), f"`spin run` stdout did not yield version, but {stdout(p)}"
4949

5050

51-
def test_editable_conflict():
52-
"""Do we warn when a conflicting editable install is present?"""
53-
try:
54-
run(["pip", "install", "--quiet", "-e", "."])
55-
assert "Warning! An editable installation" in stdout(
56-
spin("run", "ls")
57-
), "Failed to detect and warn about editable install"
58-
finally:
59-
run(["pip", "uninstall", "--quiet", "-y", "example_pkg"])
60-
61-
6251
# Detecting whether a file is executable is not that easy on Windows,
6352
# as it seems to take into consideration whether that file is associated as an executable.
6453
@skip_on_windows

spin/tests/test_editable.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import pytest
2+
from testutil import spin, stdout
3+
4+
from spin.cmds.util import run
5+
6+
7+
@pytest.fixture
8+
def editable_install():
9+
run(["pip", "install", "--quiet", "--no-build-isolation", "-e", "."])
10+
yield
11+
run(["pip", "uninstall", "--quiet", "-y", "example_pkg"])
12+
13+
14+
def test_detect_editable(editable_install):
15+
assert "Editable install of same source detected" in stdout(
16+
spin("build")
17+
), "Failed to detect and warn about editable install"
18+
19+
20+
def test_editable_tests(editable_install):
21+
spin("test")

0 commit comments

Comments
 (0)