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

Conflicting util #303

Open
rojepp opened this issue Oct 5, 2023 · 0 comments
Open

Conflicting util #303

rojepp opened this issue Oct 5, 2023 · 0 comments

Comments

@rojepp
Copy link

rojepp commented Oct 5, 2023

Setting this extension up, it fails discovery of most tests and the tests it discovers, many fail to run because of a conflict.

Failed to import test module: api_task_test

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 407, in _find_test_path
    module = self._get_module_from_name(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
    __import__(name)
  File "/Users/rojepp/dev/cubed/tests/api_task_test.py", line 14, in <module>
    import api.api_task
  File "/Users/rojepp/dev/cubed/api/api_task.py", line 23, in <module>
    import legacy_api
  File "/Users/rojepp/dev/cubed/legacy_api.py", line 17, in <module>
    from notification import prepare_for_notification_send, send_chat_notification_to_user, send_notification_data
  File "/Users/rojepp/dev/cubed/notification.py", line 7, in <module>
    from utils import unix_time
ImportError: cannot import name 'unix_time' from 'utils' (/Users/rojepp/.vscode/extensions/ms-python.python-2023.19.12781014/pythonFiles/unittestadapter/utils.py)

It seems it's trying to import a utils.py other than the one in the root of my project. Not sure which.
This is my settings.json:

{
    "python.testing.unittestArgs": [
        "-v",
        "-s",
        "./tests",
        "-p",
        "*_test.py"
    ],
    "python.testing.pytestEnabled": false,
    "python.testing.unittestEnabled": true
   
}

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant