From 7d95e303613cfbbc9067f4813c641c61aa251dc8 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 7 Feb 2015 10:53:13 -0500 Subject: Fully embrace SkipTest with our own method. Also, no test is conditionally defined. They call self.skip if they should be skippped. --- coverage/test_helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'coverage/test_helpers.py') diff --git a/coverage/test_helpers.py b/coverage/test_helpers.py index b49e75d8..a4c73d31 100644 --- a/coverage/test_helpers.py +++ b/coverage/test_helpers.py @@ -231,6 +231,7 @@ class TempDirMixin(SysPathAwareMixin, ModuleAwareMixin, TestCase): """A value object to store per-class.""" def __init__(self): self.tests = 0 + self.skipped = 0 self.temp_dir = True self.tests_making_files = 0 self.test_method_made_any_files = False @@ -242,7 +243,9 @@ class TempDirMixin(SysPathAwareMixin, ModuleAwareMixin, TestCase): def report_on_class_behavior(cls): """Called at process exit to report on class behavior.""" for test_class, behavior in cls.class_behaviors.items(): - if behavior.temp_dir and behavior.tests_making_files == 0: + if behavior.tests == behavior.skipped: + bad = "" + elif behavior.temp_dir and behavior.tests_making_files == 0: bad = "Inefficient" elif not behavior.temp_dir and behavior.tests_making_files > 0: bad = "Unsafe" -- cgit v1.2.1