]> granicus.if.org Git - python/commit
BadDictKey test: The output file expected "raising error" to be printed
authorTim Peters <tim.peters@gmail.com>
Tue, 29 May 2001 21:14:32 +0000 (21:14 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 29 May 2001 21:14:32 +0000 (21:14 +0000)
commit9a828d3c61a6df161b2aaf0a1309e26c9884fc59
treef588e20a715f2331b29b2dd454a9924e3d1db471
parent9a374186fcb824ec1cc022348d2a7c77316b54cc
BadDictKey test:  The output file expected "raising error" to be printed
exactly once.  But the test code can't know that, as the number of times
__cmp__ is called depends on internal details of the dict implementation.
This is especially nasty because the __hash__ method returns the address
of the class object, so the hash codes seen by the dict can vary across
runs, causing the dict to use a different probe order across runs.  I
just happened to see this test fail about 1 run in 7 today, but only
under a release build and when passing -O to Python.  So, changed the test
to be predictable across runs.
Lib/test/test_operations.py