Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - Import "mock_alchemy.mocking" could not be resolved #311

Open
Sachin796 opened this issue Feb 17, 2023 · 0 comments
Open

Bug - Import "mock_alchemy.mocking" could not be resolved #311

Sachin796 opened this issue Feb 17, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Sachin796
Copy link

Describe the bug

  • 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
import unittest

# from mockalchemy.models import JSONSerializableModel
# from mock_alchemy.session import MockSession
from mock_alchemy.mocking import Base
# 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.
    image

Screenshots
If applicable, add screenshots to help explain your problem.

image

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.
@Sachin796 Sachin796 added the bug Something isn't working label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant