diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-07 10:53:13 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-07 10:53:13 -0500 |
commit | 7d95e303613cfbbc9067f4813c641c61aa251dc8 (patch) | |
tree | 7e2154fb47a6f0529f8edbe1a63d0ecee157778e /coverage/test_helpers.py | |
parent | 488981cbf86c58ec4aadcfe6b151eb50b7bf7fdf (diff) | |
download | python-coveragepy-git-7d95e303613cfbbc9067f4813c641c61aa251dc8.tar.gz |
Fully embrace SkipTest with our own method.
Also, no test is conditionally defined. They call self.skip if they
should be skippped.
Diffstat (limited to 'coverage/test_helpers.py')
-rw-r--r-- | coverage/test_helpers.py | 5 |
1 files changed, 4 insertions, 1 deletions
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" |