From 53a7dffb4e844c7293c6a21318fd9b33168d2598 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 28 Sep 2018 20:48:58 -0400 Subject: Simplify --- coverage/context.py | 8 ++------ 1 file 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 -- cgit v1.2.1