Skip to content
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

feat(spy): warn if mock used with a missing attribute #218

Merged
merged 1 commit into from
Aug 13, 2023

Conversation

mcous
Copy link
Owner

@mcous mcous commented Aug 13, 2023

This PR introduces a MissingSpecAttributeWarning that will be thrown if you try to use an attribute of a mock that does not exist on its spec. Closes #204.

In the next major version of Decoy, this warning will become an error.

Copy link
Owner Author

mcous commented Aug 13, 2023

@mcous mcous marked this pull request as ready for review August 13, 2023 18:08
@mcous mcous force-pushed the spec-method-not-found branch 3 times, most recently from 5be5a7f to 5277ada Compare August 13, 2023 18:38
Base automatically changed from docs-build-update to main August 13, 2023 21:04
@codecov
Copy link

codecov bot commented Aug 13, 2023

Codecov Report

Merging #218 (34fb688) into main (d8c6923) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #218   +/-   ##
=======================================
  Coverage   98.36%   98.37%           
=======================================
  Files          19       19           
  Lines         736      739    +3     
  Branches       87       88    +1     
=======================================
+ Hits          724      727    +3     
  Misses         10       10           
  Partials        2        2           
Files Changed Coverage Δ
decoy/spy_core.py 100.00% <100.00%> (ø)
decoy/warnings.py 100.00% <100.00%> (ø)

@mcous mcous merged commit 72cefe4 into main Aug 13, 2023
22 checks passed
@mcous mcous deleted the spec-method-not-found branch August 13, 2023 21:13
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.

Should decoy raise exceptions?
1 participant