Always pass an owner when spying on unbound methods.

Review Request #10596 — Created June 17, 2019 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

Modern versions of kgb recommend passing an owner= parameter when
spying on unbound methods. This is to ensure compatibility with Python
3.x, which doesn't have a specific concept of an unbound method
(they're just standard functions). Not passing an explicit owner can
cause spies to conflict or to stay registered past the end of a test on
Python 3.x.

This change updates all our spies on unbound methods to specify an
explicit owner.

Unit tests pass.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Always pass an owner when spying on unbound methods.
Modern versions of kgb recommend passing an `owner=` parameter when spying on unbound methods. This is to ensure compatibility with Python 3.x, which doesn't have a specific concept of an unbound method (they're just standard functions). Not passing an explicit owner can cause spies to conflict or to stay registered past the end of a test on Python 3.x. This change updates all our spies on unbound methods to specify an explicit owner.
84ff4b4e2ce9773117501fa4482ec5bf53c0dcce Christian Hammond
reviewboard/accounts/tests/test_change_password_form.py
reviewboard/accounts/tests/test_profile_form.py
reviewboard/attachments/tests.py
reviewboard/avatars/tests.py
reviewboard/diffviewer/tests/test_diffutils.py
reviewboard/hostingsvcs/testing/testcases.py
reviewboard/hostingsvcs/tests/test_bitbucket.py
reviewboard/hostingsvcs/tests/test_gerrit.py
reviewboard/hostingsvcs/tests/test_kiln.py
reviewboard/reviews/tests/test_counters.py
reviewboard/reviews/tests/test_review_request_draft.py
reviewboard/reviews/ui/tests.py
reviewboard/webapi/tests/test_draft_diff.py
reviewboard/webapi/tests/test_remote_repository.py
reviewboard/webapi/tests/test_review_comment.py
reviewboard/webapi/tests/test_review_request.py
reviewboard/webapi/tests/test_review_request_draft.py
reviewboard/webapi/tests/test_validate_diffcommit.py
Loading...