diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-08 14:49:35 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-08 14:49:35 -0400 |
commit | 83411f84debeefa313a1b61121ef4fc9c9607fd6 (patch) | |
tree | e2e74a89ff3ae8ed330a3f33c96fc645700848bf /tests | |
parent | 7540342d61b42d689cf824f8f4dfd674c474f909 (diff) | |
download | python-coveragepy-83411f84debeefa313a1b61121ef4fc9c9607fd6.tar.gz |
More --debug options, split code into separate objects.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_debug.py | 25 | ||||
-rw-r--r-- | tests/test_misc.py | 24 |
2 files changed, 27 insertions, 22 deletions
diff --git a/tests/test_debug.py b/tests/test_debug.py new file mode 100644 index 0000000..f3ae31f --- /dev/null +++ b/tests/test_debug.py @@ -0,0 +1,25 @@ +"""Tests of coverage/debug.py""" + +from coverage.debug import info_formatter +from tests.coveragetest import CoverageTest + + +class InfoFormatterTest(CoverageTest): + """Tests of misc.info_formatter.""" + + def test_info_formatter(self): + lines = list(info_formatter([ + ('x', 'hello there'), + ('very long label', ['one element']), + ('regular', ['abc', 'def', 'ghi', 'jkl']), + ('nothing', []), + ])) + self.assertEqual(lines, [ + ' x: hello there', + 'very long label: one element', + ' regular: abc', + ' def', + ' ghi', + ' jkl', + ' nothing: -none-', + ]) diff --git a/tests/test_misc.py b/tests/test_misc.py index 32243ed..50ddb17 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1,7 +1,8 @@ """Tests of miscellaneous stuff.""" + import sys -from coverage.misc import Hasher, file_be_gone, info_formatter +from coverage.misc import Hasher, file_be_gone from coverage import __version__, __url__ from tests.coveragetest import CoverageTest @@ -45,27 +46,6 @@ class RemoveFileTest(CoverageTest): self.assertRaises(OSError, file_be_gone, ".") -class InfoFormatterTest(CoverageTest): - """Tests of misc.info_formatter.""" - - def test_info_formatter(self): - lines = list(info_formatter([ - ('x', 'hello there'), - ('very long label', ['one element']), - ('regular', ['abc', 'def', 'ghi', 'jkl']), - ('nothing', []), - ])) - self.assertEqual(lines, [ - ' x: hello there', - 'very long label: one element', - ' regular: abc', - ' def', - ' ghi', - ' jkl', - ' nothing: -none-', - ]) - - class SetupPyTest(CoverageTest): """Tests of setup.py""" |