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 | e743e94e540341465175a489e82f67d3da071e77 (patch) | |
tree | cf42b8af9cfcd84019478bf8b567325535da071b /tests | |
parent | 9a54cb40b10ec08b5d4a6c6c88aadc5c5a343726 (diff) | |
download | python-coveragepy-e743e94e540341465175a489e82f67d3da071e77.tar.gz |
Use sets as much as possible to speed HTML reports. Seems to be a 10% speedup.
Diffstat (limited to 'tests')
-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 9f7c79c..f6680cc 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(""): |