mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-13 09:42:26 +03:00
Fix python executable and lang code in test
This commit is contained in:
parent
dbebe6bf4d
commit
1c25b9a5ec
|
@ -1,5 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -60,7 +61,7 @@ seed = 0
|
||||||
gpu_allocator = null
|
gpu_allocator = null
|
||||||
|
|
||||||
[nlp]
|
[nlp]
|
||||||
lang = "xx"
|
lang = "mul"
|
||||||
pipeline = ["noop", "noop2"]
|
pipeline = ["noop", "noop2"]
|
||||||
disabled = []
|
disabled = []
|
||||||
before_creation = null
|
before_creation = null
|
||||||
|
@ -160,7 +161,7 @@ after_init = null
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def data_paths():
|
def data_paths():
|
||||||
nlp = spacy.blank("xx")
|
nlp = spacy.blank("mul")
|
||||||
doc = nlp("ok")
|
doc = nlp("ok")
|
||||||
with make_tempdir() as tdir:
|
with make_tempdir() as tdir:
|
||||||
db = DocBin()
|
db = DocBin()
|
||||||
|
@ -219,7 +220,7 @@ def test_multi_code(cmd, code_paths, data_paths, noop_config):
|
||||||
# check that it fails without the code arg
|
# check that it fails without the code arg
|
||||||
cmd = cmd.split()
|
cmd = cmd.split()
|
||||||
output = ["."] if cmd[0] == "assemble" else []
|
output = ["."] if cmd[0] == "assemble" else []
|
||||||
cmd = ["python", "-m", "spacy"] + cmd
|
cmd = [sys.executable, "-m", "spacy"] + cmd
|
||||||
result = subprocess.run([*cmd, str(noop_config), *output, *data_paths])
|
result = subprocess.run([*cmd, str(noop_config), *output, *data_paths])
|
||||||
assert result.returncode == 1
|
assert result.returncode == 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user