Implemented mock support#53
Implemented mock support#53dmytrostriletskyi wants to merge 2 commits intodatadriventests:masterfrom dmytrostriletskyi:mockdata
Conversation
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
==========================================
- Coverage 100% 97.82% -2.18%
==========================================
Files 1 1
Lines 107 138 +31
==========================================
+ Hits 107 135 +28
- Misses 0 3 +3
Continue to review full report at Codecov.
|
|
Hey thanks for this! Without having yet looked into the details, this seems like a good contribution. Would you mind updating the documentation as well? I will review the implementation details. |
|
Have you considered using |
|
@txels, heyo! I think you are rigth with Let me time to refactor my stuff: I need remember Thanks you a lot for payin attention on my pull request. |
|
@dmytrostriletskyi Hi, are you still interested in this? |
|
Continuing this effort in another PR to fix and clean up some stuff. Closing this. |
Hello! I frequency use
ddtandmocktogether in my development.I always missed some features in testing, that can make me feel more comfortable.
What is new?
I implemented decorator
mockdata, that may be uses additional to commondataandunpack.This decorator says, that arguments in data values may be mock's
patchobject and related to it (after process it becomeMagicMock) attributes likereturn_valueandside_effect(optional).Usage
Simple example with arguments.
Another one.
Example, where you can see, that
Mockappliedside_effectin background and you get result right away without applying it by yourself.