Thanks to <> (author of django-treebeard) I've realized there is some nice tool (called coverage) which can report code covered during python session... This is proposal and I won't spare more time on it now but I'd strongly suggest to integrate this one - tests would definitely benefit on that.
Here is lighting fast session output:
{{{
(lukaszb) ~/develop/workspace/vcs > coverage run setup.py nosetests
running nosetests
running egg_info
writing requirements to vcs.egg-info/requires.txt
writing vcs.egg-info/PKG-INFO
writing top-level names to vcs.egg-info/top_level.txt
writing dependency_links to vcs.egg-info/dependency_links.txt
reading manifest file 'vcs.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'vcs.egg-info/SOURCES.txt'
running build_ext
vcs/backends/git.py:22: UserWarning: Git backend is only a proof by now
warnings.warn("Git backend is only a proof by now")
..vcs/backends/git.py:141: DeprecationWarning: Repo.tree(sha) is deprecated. Use Repo[sha] instead.
tree = self.repository._repo.tree(hex)
....E..E................................EEE
ERROR: test_branches (tests.test_git.GitRepositoryTest)
Traceback (most recent call last):
File "/Users/lukaszb/develop/workspace/vcs/tests/test_git.py", line 139, in test_branches
self.assertEqual(chset.branch, 'master')
AttributeError: 'GitChangeset' object has no attribute 'branch'
ERROR: test_tags (tests.test_git.GitRepositoryTest)
Traceback (most recent call last):
File "/Users/lukaszb/develop/workspace/vcs/tests/test_git.py", line 147, in test_tags
self.assertTrue(tip in self.repo.tags)
AttributeError: 'GitRepository' object has no attribute 'tags'
ERROR: test_get_backend (tests.test_vcs.VCSTest)
Traceback (most recent call last):
File "/Users/lukaszb/develop/workspace/vcs/tests/test_vcs.py", line 12, in test_get_backend
hg = get_backend('hg')
File "vcs/backends/init.py", line 26, in get_backend
if alias not in BACKENDS:
TypeError: argument of type 'NoneType' is not iterable
ERROR: test_get_repo (tests.test_vcs.VCSTest)
Traceback (most recent call last):
File "/Users/lukaszb/develop/workspace/vcs/tests/test_vcs.py", line 22, in test_get_repo
backend = get_backend(alias)
File "vcs/backends/init.py", line 26, in get_backend
if alias not in BACKENDS:
TypeError: argument of type 'NoneType' is not iterable
ERROR: test_wrong_alias (tests.test_vcs.VCSTest)
Traceback (most recent call last):
File "/Users/lukaszb/develop/workspace/vcs/tests/test_vcs.py", line 17, in test_wrong_alias
self.assertRaises(VCSError, get_backend, alias)
File "/usr/local/Cellar/python/2.6.5/lib/python2.6/unittest.py", line 336, in failUnlessRaises
callableObj(_args, *_kwargs)
File "vcs/backends/init.py", line 26, in get_backend
if alias not in BACKENDS:
TypeError: argument of type 'NoneType' is not iterable
Ran 45 tests in 3.501s
FAILED (errors=5)
(lukaszb) ~/develop/workspace/vcs > coverage report -m
Name Stmts Exec Cover Missing
setup 12 9 75% 10-13
tests/init 10 8 80% 47-48
tests/conf 7 7 100%
tests/simplevcs/init 1 1 100%
tests/simplevcs/test_settings 1 1 100%
tests/test_git 81 77 95% 141-143, 241
tests/test_hg 201 199 99% 217, 398
tests/test_nodes 64 63 98% 129
tests/test_utils 14 13 92% 28
tests/test_vcs 19 14 73% 13, 23-26, 29
tests/utils 38 25 65% 22, 27, 33-36, 45-46, 63, 65, 72-77
vcs/init 7 7 100%
vcs/backends/init 16 8 50% 16-19, 27-31
vcs/backends/base 88 55 62% 35, 41, 44, 49, 53, 57, 63, 66, 77, 85-86, 97, 120, 123, 126, 133, 136, 139, 142, 173, 181, 188, 196, 202, 208, 215, 221, 228, 236, 243, 257, 264, 271
vcs/backends/git 164 146 89% 40, 46, 49, 52, 56, 85, 117, 153-154, 163, 171-173, 188, 193, 211, 229, 233
vcs/backends/hg 262 210 80% 36-57, 65-71, 103, 130, 156, 159, 163, 171, 175, 180-184, 215, 228-229, 246, 259, 268, 275, 294, 299, 324-325, 332-333, 339-341, 375
vcs/exceptions 7 7 100%
vcs/nodes 215 166 77% 50, 54-59, 79, 99, 108, 175, 205, 210-212, 217-219, 230-240, 244, 264, 272, 280-282, 307, 327, 332, 352, 374, 405, 414-423, 439
vcs/utils/init 1 1 100%
vcs/utils/diffs 195 21 10% 18-44, 59-71, 74, 82-83, 89-103, 110-133, 139-163, 169-271, 278, 284, 293-363
vcs/utils/imports 12 2 16% 15-26
vcs/utils/lazy 9 9 100%
vcs/utils/paths 10 10 100%
vcs/web/init 1 1 100%
vcs/web/exceptions 3 3 100%
vcs/web/simplevcs/init 0 0 100%
vcs/web/simplevcs/exceptions 4 4 100%
vcs/web/simplevcs/models 38 19 50% 9-10, 18-19, 23, 26, 29, 32-33, 36-37, 40, 43, 46, 49-53
vcs/web/simplevcs/settings 10 9 90% 9
vcs/web/simplevcs/utils 104 31 29% 35-49, 55-60, 66-73, 80-84, 91-92, 95, 99-101, 104-106, 115-128, 135-138, 145-152, 159-162, 168-173, 184-193
vcs/web/simplevcs/views/init 3 3 100%
vcs/web/simplevcs/views/diffs 19 7 36% 51-72
vcs/web/simplevcs/views/hg 36 8 22% 40-91
vcs/web/simplevcs/views/repository 15 6 40% 48-63
TOTAL 1667 1150 68%
}}}
Reference: https://bitbucket.org/marcinkuzminski/vcs/issues/10/