summaryrefslogtreecommitdiff
path: root/coverage/context.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-09-28 20:48:58 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-09-28 20:48:58 -0400
commit53a7dffb4e844c7293c6a21318fd9b33168d2598 (patch)
tree3c5e9f352365484aa4ba057aaab36955842cd56e /coverage/context.py
parentcb777b033f49ef18ef8e9098404a50df56bf8207 (diff)
downloadpython-coveragepy-git-53a7dffb4e844c7293c6a21318fd9b33168d2598.tar.gz
Simplify
Diffstat (limited to 'coverage/context.py')
-rw-r--r--coverage/context.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/coverage/context.py b/coverage/context.py
index c3416208..25be98c5 100644
--- a/coverage/context.py
+++ b/coverage/context.py
@@ -5,8 +5,7 @@
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"):
+ if frame.f_code.co_name.startswith("test"):
return qualname_from_frame(frame)
return None
@@ -18,12 +17,9 @@ def qualname_from_frame(frame):
if not co.co_varnames:
return fname
- locs = frame.f_locals
first_arg = co.co_varnames[0]
if co.co_argcount and first_arg == "self":
- self = locs["self"]
- #elif co.co_flags & 0x04: # *args syntax
- # self = locs[first_arg][0]
+ self = frame.f_locals["self"]
else:
return fname