summaryrefslogtreecommitdiff
path: root/coverage/context.py
blob: 24d01f2a977f658a5a139629a5a835c4d7b685b3 (plain)
1
2
3
4
5
6
7
8
9
10
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