We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbc2229 commit 58ff79eCopy full SHA for 58ff79e
1 file changed
discretize/tests.py
@@ -25,7 +25,6 @@
25
assert_isadjoint
26
""" # NOQA D205
27
28
-import os
29
import warnings
30
31
import numpy as np
@@ -85,10 +84,9 @@
85
84
86
87
def _warn_random_test():
88
- in_pytest = "PYTEST_CURRENT_TEST" in os.environ
89
- in_nosetest = any(
90
- x[0].f_globals["__name__"].startswith("nose.") for x in inspect.stack()
91
- )
+ stack = inspect.stack()
+ in_pytest = any(x[0].f_globals["__name__"].startswith("_pytest.") for x in stack)
+ in_nosetest = any(x[0].f_globals["__name__"].startswith("nose.") for x in stack)
92
93
if in_pytest or in_nosetest:
94
test = "pytest" if in_pytest else "nosetest"
0 commit comments