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
I am getting the error Import "mock_alchemy.mocking" could not be resolved in the test file when I hover over the import. And when I run the test using pytest tests/test_mock.py it give the error E ImportError: cannot import name 'Base' from 'mock_alchemy.mocking'
To Reproduce
Create new folder called test
Setup virtual environment.
python -m virtualenv env
source env/Scripts/activate
pip install pytest mock-alchemy unittest2
importunittest# from mockalchemy.models import JSONSerializableModel# from mock_alchemy.session import MockSessionfrommock_alchemy.mockingimportBase# from mock_alchemy.mocking import AlchemyMagicMock# from mock_alchemy import AlchemyMagicMock
Error will be shown as in the image below.
Expected behavior
The mock_alchemy.mocking should not show could not be resolved.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: Windows 10 Pro
Edition
Version 22H2
OS build 19045.2486
Experience Windows Feature Experience Pack 120.2212.4190.0
Additional context
I am not sure what I am missing.
I tried to install all the packages using pip install commands and then pip freeze > requirements.txt and also added the dependencies to requirements.txt and then install requirements.txt dependencies, but none seems to work.
The text was updated successfully, but these errors were encountered:
Describe the bug
Import "mock_alchemy.mocking" could not be resolved
in the test file when I hover over the import. And when I run the test usingpytest tests/test_mock.py
it give the errorE ImportError: cannot import name 'Base' from 'mock_alchemy.mocking'
To Reproduce
test
python -m virtualenv env
source env/Scripts/activate
pip install pytest mock-alchemy unittest2
Expected behavior
mock_alchemy.mocking
should not showcould not be resolved
.Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
pip install
commands and thenpip freeze > requirements.txt
and also added the dependencies torequirements.txt
and then install requirements.txt dependencies, but none seems to work.The text was updated successfully, but these errors were encountered: