You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wherein I have other test cases which uses ddt.data and ddt.unpack as depicted. Now when I run the test cases it fails in the test_case1 and I believe this i something to do with ddt:
Hence, I feel there's something which is missing, like you can provide custom value to patch decorators with mock, while the class under test gets decorated by @ddt.ddt Thank you.
The text was updated successfully, but these errors were encountered:
My guess is that this has nothing to do with ddt, and you are just using @mock.patch.object incorrectly. When you use the 3-arg version of patch.object, it won't pass a mock as an additional argument to your function, since it doesn't create one.
thank you very much, @txels
yes, you were right. I was wrong in interpreting and was using the 3rd argument with patchers in a wrong manner. Thanks for pin-pointing the issue.
👍
I am running a test case under a test class as:
wherein I have other test cases which uses ddt.data and ddt.unpack as depicted. Now when I run the test cases it fails in the test_case1 and I believe this i something to do with ddt:
But if I remove the custom value in the patching decorator, then it works fine.
Hence, I feel there's something which is missing, like you can provide custom value to patch decorators with mock, while the class under test gets decorated by
@ddt.ddt
Thank you.The text was updated successfully, but these errors were encountered: