Skip to content

fix(spy): handle properties that return primitive types #132

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
May 10, 2022

Conversation

mcous
Copy link
Owner

@mcous mcous commented May 10, 2022

Trying to get the signature of an @property that is typed with something like int or str will cause decoy to raise an error from inspect.signature. This PR fixes that issue.

This was a regression introduced in #108 which narrowed the except around inspect.signature from Exception to TypeError. As stated in the Python docs, inspect.signature:

Raises ValueError if no signature can be provided, and TypeError if that type of object is not supported.

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #132 (32b1e90) into main (184ec01) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #132   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files          19       19           
  Lines         704      704           
  Branches      120      120           
=======================================
  Hits          692      692           
  Misses         10       10           
  Partials        2        2           
Impacted Files Coverage Δ
decoy/spec.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 184ec01...32b1e90. Read the comment docs.

@mcous mcous merged commit 6eebc5a into main May 10, 2022
@mcous mcous deleted the fix-inspect-primitive branch May 10, 2022 22:34
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.

1 participant