summaryrefslogtreecommitdiff
path: root/coverage/context.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/context.py')
-rw-r--r--coverage/context.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/coverage/context.py b/coverage/context.py
new file mode 100644
index 00000000..24d01f2a
--- /dev/null
+++ b/coverage/context.py
@@ -0,0 +1,11 @@
+# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
+
+"""Determine contexts for coverage.py"""
+
+def should_start_context_test_function(frame):
+ """Is this frame calling a test_* function?"""
+ fn_name = frame.f_code.co_name
+ if fn_name.startswith("test"):
+ return fn_name
+ return None