From 28f2a0f12dfa59deb403609dcb5fc6eef58e8e7b Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Tue, 23 Feb 2016 10:51:25 -0800 Subject: [PATCH] test_util: tolerate unordered repr of NumDict NumDict does not make any claims about the order of its repr(), so the test needs to be prepared for it to be stringified in any order. On unix the old test happened to pass, but on certain windows boxes (maybe certain versions of python?), it failed. Fixes ticket:2736. --- src/allmydata/test/test_util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/allmydata/test/test_util.py b/src/allmydata/test/test_util.py index e59e14aba..700049413 100644 --- a/src/allmydata/test/test_util.py +++ b/src/allmydata/test/test_util.py @@ -1353,7 +1353,8 @@ class DictUtil(unittest.TestCase): self.failUnlessEqual(d.item_with_largest_value(), ("b", 6)) d = dictutil.NumDict({"a": 1, "b": 2}) - self.failUnlessEqual(repr(d), "{'a': 1, 'b': 2}") + self.failUnlessIn(repr(d), ("{'a': 1, 'b': 2}", + "{'b': 2, 'a': 1}")) self.failUnless("a" in d) d2 = dictutil.NumDict({"c": 3, "d": 4})