mcous / decoy

🦆 Opinionated mocking library for Python
https://michael.cousins.io/decoy/
MIT License
26 stars 1 forks source link

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

Closed mcous closed 1 year ago

mcous commented 1 year ago

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.

mcous commented 1 year ago

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

codecov[bot] commented 1 year ago

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%> (ø)