Skip to content

[3.11] gh-75988: Fix issues with autospec ignoring wrapped object (GH-115223) #117124

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

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

infohash
Copy link
Contributor

@infohash infohash commented Mar 21, 2024

  • Added a condition to take wraps into consideration when autospeccing objects

  • Added test cases to test wraps of a class, a class instance and a function type

  • Added order of precedence of side_effect, return_value and wraps in docs

(cherry picked from commit 735fc2c)


📚 Documentation preview 📚: https://cpython-previews--117124.org.readthedocs.build/

…hon#115223)

* set default return value of functional types as _mock_return_value

* added test of wrapping child attributes

* added backward compatibility with explicit return

* added docs on the order of precedence

* added test to check default return_value

(cherry picked from commit 735fc2c)
@cjw296 cjw296 merged commit 51da1dd into python:3.11 Mar 22, 2024
@cjw296
Copy link
Contributor

cjw296 commented Mar 22, 2024

Thanks for doing the backports!

@infohash infohash deleted the backport-735fc2c-3.11 branch March 22, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants