From 0aa1b6914ebca06dbfc01d25b65777f828cfcbc4 Mon Sep 17 00:00:00 2001 From: John Bauer Date: Mon, 20 Apr 2020 17:09:05 -0700 Subject: [PATCH] Reuse an existing function --- tests/test_server_misc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_server_misc.py b/tests/test_server_misc.py index 81f7f3b82b..d625335496 100644 --- a/tests/test_server_misc.py +++ b/tests/test_server_misc.py @@ -5,6 +5,7 @@ import pytest import re import stanza.server as corenlp +from tests import compare_ignoring_whitespace pytestmark = pytest.mark.client @@ -40,7 +41,7 @@ def test_english_request(): """ Test case of starting server with Spanish defaults, and then requesting default English properties """ with corenlp.CoreNLPClient(properties='spanish', server_id='test_english_request') as client: ann = client.annotate(EN_DOC, properties_key='english', output_format='text') - assert re.sub('[ \t]+', ' ', ann.strip()) == re.sub('[ \t]+', ' ', EN_DOC_GOLD.strip()) + compare_ignoring_whitespace(ann, EN_DOC_GOLD)