diff options
-rw-r--r-- | CHANGES.rst | 2 | ||||
-rw-r--r-- | coverage/misc.py | 1 | ||||
-rw-r--r-- | tests/test_misc.py | 7 |
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 7ec72811..ce645543 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -615,7 +615,7 @@ Version 4.1b2 --- 2016-01-23 - Class docstrings were considered executable. Now they no longer are. - ``yield from`` and ``await`` were considered returns from functions, since - they could tranfer control to the caller. This produced unhelpful "missing + they could transfer control to the caller. This produced unhelpful "missing branch" reports in a number of circumstances. Now they no longer are considered returns. diff --git a/coverage/misc.py b/coverage/misc.py index 78ec027f..ab950846 100644 --- a/coverage/misc.py +++ b/coverage/misc.py @@ -226,6 +226,7 @@ class Hasher(object): continue self.update(k) self.update(a) + self.md5.update(b'.') def hexdigest(self): """Retrieve the hex digest of the hash.""" diff --git a/tests/test_misc.py b/tests/test_misc.py index f3d485cc..1d01537b 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -47,6 +47,13 @@ class HasherTest(CoverageTest): h2.update({'b': 23, 'a': 17}) self.assertEqual(h1.hexdigest(), h2.hexdigest()) + def test_dict_collision(self): + h1 = Hasher() + h1.update({'a': 17, 'b': {'c': 1, 'd': 2}}) + h2 = Hasher() + h2.update({'a': 17, 'b': {'c': 1}, 'd': 2}) + self.assertNotEqual(h1.hexdigest(), h2.hexdigest()) + class RemoveFileTest(CoverageTest): """Tests of misc.file_be_gone.""" |