jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1249040?usp=email )

Change subject: Sphinx: Add a dummy pytest class if SPHINX_RUNNING
......................................................................

Sphinx: Add a dummy pytest class if SPHINX_RUNNING

Bug: T419320
Change-Id: Ia5fcf5b5a13e9a934697b54a86125d4386adb66d
---
M conftest.py
1 file changed, 14 insertions(+), 2 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/conftest.py b/conftest.py
index dca35ef..eb2115d 100644
--- a/conftest.py
+++ b/conftest.py
@@ -20,8 +20,20 @@
 try:
     import pytest
 except ModuleNotFoundError:
-    pytest = None
+    if SPHINX_RUNNING:

+        class _DummyPytest:
+
+            def fixture(self, *args, **kwargs):
+
+                def wrapper(func):
+                    return func
+
+                return wrapper
+
+        pytest = _DummyPytest()
+    else:
+        pytest = None

 EXCLUDE_PATTERN = re.compile(
     r'(?:'
@@ -91,7 +103,7 @@
     )


-if pytest or SPHINX_RUNNING:
+if pytest:

     @pytest.fixture(autouse=True)
     def pause_between_doctests(request) -> None:

--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1249040?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia5fcf5b5a13e9a934697b54a86125d4386adb66d
Gerrit-Change-Number: 1249040
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to