Skip to content

Commit 1dab13e

Browse files
committed
Check for editable install before running tests
1 parent d772e0c commit 1dab13e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.spin/cmds.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import importlib
12
import sys
3+
import textwrap
24

35
import click
46
from spin.cmds.util import run
@@ -14,6 +16,20 @@
1416
)
1517
def test(pytest_args, coverage=False):
1618
"""🔧 Run tests"""
19+
if not importlib.util.find_spec("lazy_loader"):
20+
click.secho(
21+
textwrap.dedent("""\
22+
ERROR: The package is not installed.
23+
24+
Please do an editable install:
25+
26+
pip install -e .[test]
27+
28+
prior to running the tests."""),
29+
fg="red",
30+
)
31+
sys.exit(1)
32+
1733
if coverage:
1834
pytest_args = ("--cov=lazy_loader", *pytest_args)
1935
run([sys.executable, "-m", "pytest", *list(pytest_args)])

0 commit comments

Comments
 (0)