New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests/unit/glacier/test_writer.py to make work with pypy. #3762

Merged
merged 1 commit into from Sep 18, 2017

Conversation

Projects
None yet
2 participants
@markhjelm
Copy link
Contributor

markhjelm commented Sep 14, 2017

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).

Fix to make work with pypy.
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).

@mfschwartz mfschwartz merged commit 8402c5d into boto:develop Sep 18, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@markhjelm markhjelm referenced this pull request Jan 16, 2018

Open

New boto release ? #3786

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment