@@ -311,7 +311,8 @@ def tokenize(self, text, properties=None):
311311 """Tokenize a string of text.
312312
313313 Skip these tests if CoreNLP is likely not ready.
314- >>> if "CLASSPATH" not in os.environ: import pytest; pytest.skip("CoreNLP jars unavailable")
314+ >>> from nltk.test.setup_fixt import check_jar
315+ >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
315316
316317 The CoreNLP server can be started using the following notation, although
317318 we recommend the `with CoreNLPServer() as server:` context manager notation
@@ -367,7 +368,8 @@ def tag(self, sentence: str) -> List[Tuple[str, str]]:
367368 :rtype: list(tuple(str, str))
368369
369370 Skip these tests if CoreNLP is likely not ready.
370- >>> if "CLASSPATH" not in os.environ: import pytest; pytest.skip("CoreNLP jars unavailable")
371+ >>> from nltk.test.setup_fixt import check_jar
372+ >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
371373
372374 The CoreNLP server can be started using the following notation, although
373375 we recommend the `with CoreNLPServer() as server:` context manager notation
@@ -422,7 +424,8 @@ def raw_tag_sents(self, sentences):
422424class CoreNLPParser (GenericCoreNLPParser ):
423425 """
424426 Skip these tests if CoreNLP is likely not ready.
425- >>> if "CLASSPATH" not in os.environ: import pytest; pytest.skip("CoreNLP jars unavailable")
427+ >>> from nltk.test.setup_fixt import check_jar
428+ >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
426429
427430 The recommended usage of `CoreNLPParser` is using the context manager notation:
428431 >>> with CoreNLPServer() as server:
@@ -586,7 +589,8 @@ class CoreNLPDependencyParser(GenericCoreNLPParser):
586589 """Dependency parser.
587590
588591 Skip these tests if CoreNLP is likely not ready.
589- >>> if "CLASSPATH" not in os.environ: import pytest; pytest.skip("CoreNLP jars unavailable")
592+ >>> from nltk.test.setup_fixt import check_jar
593+ >>> check_jar(CoreNLPServer._JAR, env_vars=("CORENLP",), is_regex=True)
590594
591595 The recommended usage of `CoreNLPParser` is using the context manager notation:
592596 >>> with CoreNLPServer() as server:
0 commit comments