Created
October 13, 2016 21:43
-
-
Save cyberbikepunk/bd9e3a8df1cb9fab9898b9243880f3cf to your computer and use it in GitHub Desktop.
is test?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_test(): | |
"""Return true if runtime is a pytest.""" | |
this_frame = inspect.currentframe() | |
all_frames = inspect.getouterframes(this_frame) | |
for frame in all_frames: | |
if 'pytest' in str(frame): | |
return True | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment