From 368676b837045636141238ac295ac302e099611a Mon Sep 17 00:00:00 2001 From: Albertas Agejevas Date: Thu, 24 Jan 2019 09:33:23 -0500 Subject: Handle TestCase classes with just one test, too. --- coverage/context.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'coverage/context.py') diff --git a/coverage/context.py b/coverage/context.py index 9ef680a3..fb1b76ac 100644 --- a/coverage/context.py +++ b/coverage/context.py @@ -36,7 +36,8 @@ def combine_context_switchers(context_switchers): def should_start_context_test_function(frame): """Is this frame calling a test_* function?""" - if frame.f_code.co_name.startswith("test"): + co_name = frame.f_code.co_name + if co_name.startswith("test") or co_name == "runTest": return qualname_from_frame(frame) return None -- cgit v1.2.1