summaryrefslogtreecommitdiff
path: root/coverage/backunittest.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-21 20:32:39 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-21 20:32:39 -0400
commit2147f7a65af6a9faa034771f15453b3260fad142 (patch)
treedd95df8bbccdfd30f469e054278b73e936e9b112 /coverage/backunittest.py
parentea9e81b1f5459e7b9155a40215251ed24140f8a8 (diff)
downloadpython-coveragepy-git-2147f7a65af6a9faa034771f15453b3260fad142.tar.gz
Data files are now JSON instead of pickles. Fixes #236.
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 95b6fcc6..5aff043f 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):