Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix tests/unit/glacier/test_writer.py to make work with pypy. #3762
Also see #3761 for discussion.
Remove explicit name from expected _Call.
A recent unrelated boto commit exposed a new failure mode in this test when running against pypy (only). The breakage appears to be due to an underlying change in the behavior of pypy, expressed when using assert_has_calls() from mock.py. Investigation revealed that eq in _Call from mock.py is not symmetric (intentionally, related to wildcard tests), and pypy (now?) passes the arguments to eq in the remove method for the built-in list type in a different order than other Python implementations. Including ".layer1.upload_part" in the name of a _Call triggers the problem when mock.py compares it with the unnamed _Call instance it captures internally. Removing the extended name enables the test to perform correctly when run with both pypy and Python 2.7.6 (and presumably others).
See https://bitbucket.org/pypy/pypy/issues/2352/list__contains__-compares-objects-in-wrong and https://bitbucket.org/pypy/pypy/commits/4bd027dc94a24293c504f60f1cea9070a79af0e0 for possibly related pypy changes (although I didn't fully trace the timeline).