• Tim Peters's avatar
    BadDictKey test: The output file expected "raising error" to be printed · 9a828d3c
    Tim Peters yazdı
    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.
    9a828d3c
test_operations.py 1.67 KB