[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2736: test_numdict fails: repr is not sorted
Tahoe-LAFS
trac at tahoe-lafs.org
Tue Feb 23 06:24:25 UTC 2016
#2736: test_numdict fails: repr is not sorted
--------------------+---------------------------
Reporter: warner | Owner:
Type: defect | Status: new
Priority: normal | Milestone: undecided
Component: code | Version: 1.10.2
Keywords: | Launchpad Bug:
--------------------+---------------------------
While setting up a windows unit test machine on Appveyor (#2344), I saw a
consistent unit test failure:
{{{
[FAIL]
Traceback (most recent call last):
File "C:\projects\tahoe-lafs\.tox\py\lib\site-
packages\allmydata\test\test_util.py", line 1356, in test_numdict
self.failUnlessEqual(repr(d), "{'a': 1, 'b': 2}")
File "C:\projects\tahoe-lafs\.tox\py\lib\site-
packages\twisted\trial\_synctest.py", line 437, in assertEqual
super(_Assertions, self).assertEqual(first, second, msg)
File "C:\Python27-x64\Lib\unittest\case.py", line 513, in assertEqual
assertion_func(first, second, msg=msg)
File "C:\Python27-x64\Lib\unittest\case.py", line 506, in
_baseAssertEqual
raise self.failureException(msg)
twisted.trial.unittest.FailTest: "{'b': 2, 'a': 1}" != "{'a': 1, 'b': 2}"
allmydata.test.test_util.DictUtil.test_numdict
}}}
It looks like this test is inappropriately requiring that the repr of a
`dictutil.NumDict` is sorted, when the implementation delegates `__repr__`
directly to the underlying (normal) dictionary, which of course makes no
guarantees about ordering.
I think that assertion should just be deleted, but maybe you want to
change the implementation to provide a stable repr instead. Or maybe we
should delete `NumDict`.. it only appears to be used in one obscure
logging tool.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2736>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list