Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I'm trying to use pyunitt test with mock patch. I have placed my code in dataiku libraries.
When im calling this code with scenario it is giving error " ImportError : No module named mock"
here is my import :
import unittestfrom unittest import TestCase, main, mock
Need help in how to use mock.
Can you confirm if you are using Python2 or Python3? unittest is buil-in package.
However you may need to add mock to the "Packages to Install" list of the code env. Then use :
Steps to do so are discussed in this thread . Once you are sure mock is installed you can import like :
In Python 3:
in Python2 :
Let us know if that works for you.
Post a Question