From a5b6d92ea30f5e7ed72c3bebd7f8566602009a64 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Thu, 15 Dec 2022 10:03:19 +0100 Subject: [PATCH] Allow conftest.py to run twice for build envs (#11978) Co-authored-by: Ines Montani --- spacy/tests/conftest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spacy/tests/conftest.py b/spacy/tests/conftest.py index ad545bcfd..af286ed5c 100644 --- a/spacy/tests/conftest.py +++ b/spacy/tests/conftest.py @@ -6,7 +6,13 @@ from spacy.util import get_lang_class def pytest_addoption(parser): - parser.addoption("--slow", action="store_true", help="include slow tests") + try: + parser.addoption("--slow", action="store_true", help="include slow tests") + parser.addoption("--issue", action="store", help="test specific issues") + # Options are already added, e.g. if conftest is copied in a build pipeline + # and runs twice + except ValueError: + pass def pytest_runtest_setup(item):