summaryrefslogtreecommitdiff
path: root/coverage/backunittest.py
diff options
context:
space:
mode:
authorNed Batchelder <nedbat@gmail.com>2015-07-21 21:06:05 -0400
committerNed Batchelder <nedbat@gmail.com>2015-07-21 21:06:05 -0400
commitcf43af31d35ba527e778267c14e51c56c9c3a773 (patch)
tree75d7a4c751862f64f79474d41815ef11d224486a /coverage/backunittest.py
parent130f0dcdff98a1f947784f6989d1984b73b28335 (diff)
parenta591430903ed9108c8cb50369be0d9d9c1a0b200 (diff)
downloadpython-coveragepy-cf43af31d35ba527e778267c14e51c56c9c3a773.tar.gz
Merged in twexler/coverage.py (pull request #58)
Don't use SourceForge anymore for Cobertura DTD
Diffstat (limited to 'coverage/backunittest.py')
-rw-r--r--coverage/backunittest.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/coverage/backunittest.py b/coverage/backunittest.py
index 95b6fcc..5aff043 100644
--- a/coverage/backunittest.py
+++ b/coverage/backunittest.py
@@ -22,10 +22,13 @@ class TestCase(unittest.TestCase):
"""
# pylint: disable=missing-docstring
- if not unittest_has('assertCountEqual'):
- def assertCountEqual(self, s1, s2):
- """Assert these have the same elements, regardless of order."""
- self.assertEqual(set(s1), set(s2))
+ # Many Pythons have this method defined. But PyPy3 has a bug with it
+ # somehow (https://bitbucket.org/pypy/pypy/issues/2092), so always use our
+ # own implementation that works everywhere, at least for the ways we're
+ # calling it.
+ def assertCountEqual(self, s1, s2):
+ """Assert these have the same elements, regardless of order."""
+ self.assertEqual(sorted(s1), sorted(s2))
if not unittest_has('assertRaisesRegex'):
def assertRaisesRegex(self, *args, **kwargs):