Skip to content

Commit 99e9515

Browse files
committed
[docs] add method to detect whether examples are run within pytest context
1 parent 444aae5 commit 99e9515

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/source/examples/util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import os
2+
3+
def is_running_under_pytest():
4+
return "PYTEST_CURRENT_TEST" in os.environ

0 commit comments

Comments
 (0)