testing-cabal / mock

The Python mock library

Home Page:https://docs.python.org/dev/library/unittest.mock.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can we get mock supported in python 3.8

KrishnaYadav2102 opened this issue · comments

Can we get mock supported in python 3.8

Getting following error while running unittests in python3.8 environment
Traceback (most recent call last): File "/Users/krishnayadav/Krishna/repositorties/pytractor/src/pytractor/tests/unit/test_mixins.py", line 236, in test_title self.verify_super_property_called_with_wait('title') File "/Users/krishnayadav/Krishna/repositorties/pytractor/src/pytractor/tests/unit/test_mixins.py", line 213, in verify_super_property_called_with_wait with patch( File "/Users/krishnayadav/Krishna/repositorties/pytractor/venv3.8/lib/python3.8/site-packages/mock/mock.py", line 1421, in __enter__ self.target = self.getter() File "/Users/krishnayadav/Krishna/repositorties/pytractor/venv3.8/lib/python3.8/site-packages/mock/mock.py", line 1595, in <lambda> getter = lambda: _importer(target) File "/Users/krishnayadav/Krishna/repositorties/pytractor/venv3.8/lib/python3.8/site-packages/mock/mock.py", line 1245, in _importer thing = __import__(import_path) ModuleNotFoundError: No module named '__builtin__'

Mock is supported on Python 3.8:
https://github.com/testing-cabal/mock/blob/master/.circleci/config.yml#L33-L35

I can't see any mention of Mock in the above traceback, so I'm afraid your problem likely lies elsewhere.

Thanks for looking into it so quickly. I found the issue.