Skip to content

Commit 4967496

Browse files
committed
Update test_cli_launcher
1 parent 8a318db commit 4967496

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

‎spacy/tests/test_cli_launcher.py‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import pytest
66

7-
from spacy_cli.build_manifest import build_manifest
87
from spacy_cli.static import load_manifest
98

109
launcher_module = importlib.import_module("spacy_cli.main")
@@ -46,7 +45,21 @@ def test_load_for_argv_imports_project_on_demand():
4645

4746

4847
def test_manifest_is_current():
49-
assert build_manifest() == load_manifest()
48+
# Run in a subprocess to avoid command registration order being affected
49+
# by other test modules importing CLI submodules (which register commands
50+
# as a side effect of import).
51+
result = subprocess.run(
52+
[
53+
sys.executable,
54+
"-c",
55+
"from spacy_cli.build_manifest import build_manifest; "
56+
"from spacy_cli.static import load_manifest; "
57+
"assert build_manifest() == load_manifest()",
58+
],
59+
capture_output=True,
60+
text=True,
61+
)
62+
assert result.returncode == 0, result.stderr
5063

5164

5265
def test_launcher_root_help_uses_static(capsys, monkeypatch):

0 commit comments

Comments
 (0)