diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-23 22:19:26 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-10-23 22:19:26 -0400 |
commit | 1404665ed8870771c47fb132273275b1f6a5ab7a (patch) | |
tree | d815f14d04031d245998df710f4f221871eddf29 /tests/coveragetest.py | |
parent | 0c4301407a04bebe15488640cc26f9cf90f30563 (diff) | |
download | python-coveragepy-git-1404665ed8870771c47fb132273275b1f6a5ab7a.tar.gz |
Use sets as much as possible to speed HTML reports. Seems to be a 10% speedup.
Diffstat (limited to 'tests/coveragetest.py')
-rw-r--r-- | tests/coveragetest.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 9f7c79c9..f6680cc9 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -355,20 +355,21 @@ class CoverageTest(TestCase): # Get the analysis results, and check that they are right. analysis = cov._analyze(mod) + statements = sorted(analysis.statements) if lines is not None: if type(lines[0]) == type(1): # lines is just a list of numbers, it must match the statements # found in the code. - self.assertEqual(analysis.statements, lines) + self.assertEqual(statements, lines) else: # lines is a list of possible line number lists, one of them # must match. for line_list in lines: - if analysis.statements == line_list: + if statements == line_list: break else: self.fail("None of the lines choices matched %r" % - analysis.statements + statements ) if type(missing) == type(""): |