mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-02 11:20:19 +03:00
Normalize whitespace in evaluate CLI output test
Depending on terminal settings, lines may be padded to the screen width so the comparison is too strict with only the command string replacement.
This commit is contained in:
parent
950fceceb6
commit
f4e98812fe
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typer.testing import CliRunner
|
||||
|
||||
|
@ -37,6 +38,8 @@ def test_benchmark_accuracy_alias():
|
|||
# Verify that the `evaluate` alias works correctly.
|
||||
result_benchmark = CliRunner().invoke(app, ["benchmark", "accuracy", "--help"])
|
||||
result_evaluate = CliRunner().invoke(app, ["evaluate", "--help"])
|
||||
assert result_benchmark.stdout == result_evaluate.stdout.replace(
|
||||
"spacy evaluate", "spacy benchmark accuracy"
|
||||
assert re.sub(r"\s+", " ", result_benchmark.stdout) == re.sub(
|
||||
r"\s+",
|
||||
" ",
|
||||
result_evaluate.stdout.replace("spacy evaluate", "spacy benchmark accuracy"),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user