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 | c5144455d0f571c002678d369ec32707c6304e1f (patch) | |
tree | dca4cabafa20065a08d071d93d904a932bb7bbbb /coverage/test_helpers.py | |
parent | d6e2d5c1034a7cc0e2bfac251bfe5b4ec8c73036 (diff) | |
download | python-coveragepy-c5144455d0f571c002678d369ec32707c6304e1f.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 b49e75d..a4c73d3 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" |