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'm working on a new module for https://nats.io/
How does module discovery work?
For instance VSCode test discovery is unhappy with the new module
_______________ ERROR collecting modules/nats/tests/test_nats.py _______________
ImportError while importing test module '/workspaces/testcontainers-python/modules/nats/tests/test_nats.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
modules/nats/tests/test_nats.py:1: in <module>
from testcontainers.nats import NatsContainer
E ModuleNotFoundError: No module named 'testcontainers.nats'
=========================== short test summary info ============================
ERROR modules/nats/tests/test_nats.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
===================== 44 tests collected, 1 error in 0.97s =====================
Thinking this is a VScode issue I tried via just poetry
(testcontainers-_53phrdA-py3.11) vscode ➜ /workspaces/testcontainers-python (feature/nats) $ poetry run pytest -v --cov=testcontainers.$* modules/nats/tests
===================================================== test session starts ======================================================
platform linux -- Python 3.11.8, pytest-7.4.3, pluggy-1.4.0 -- /home/vscode/.cache/pypoetry/virtualenvs/testcontainers-_53phrdA-py3.11/bin/python
cachedir: .pytest_cache
rootdir: /workspaces/testcontainers-python
configfile: pyproject.toml
plugins: cov-4.1.0, anyio-4.3.0
collected 0 items / 1 error
/home/vscode/.cache/pypoetry/virtualenvs/testcontainers-_53phrdA-py3.11/lib/python3.11/site-packages/coverage/inorout.py:503: CoverageWarning: Module testcontainers. was never imported. (module-not-imported)
self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
/home/vscode/.cache/pypoetry/virtualenvs/testcontainers-_53phrdA-py3.11/lib/python3.11/site-packages/coverage/control.py:885: CoverageWarning: No data was collected. (no-data-collected)
self._warn("No data was collected.", slug="no-data-collected")
WARNING: Failed to generate report: No data to report.
/home/vscode/.cache/pypoetry/virtualenvs/testcontainers-_53phrdA-py3.11/lib/python3.11/site-packages/pytest_cov/plugin.py:312: CovReportWarning: Failed to generate report: No data to report.
warnings.warn(CovReportWarning(message))
============================================================ ERRORS ============================================================
_______________________________________ ERROR collecting modules/nats/tests/test_nats.py _______________________________________
ImportError while importing test module '/workspaces/testcontainers-python/modules/nats/tests/test_nats.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
modules/nats/tests/test_nats.py:1: in <module>
from testcontainers.nats import NatsContainer
E ModuleNotFoundError: No module named 'testcontainers.nats'
I think my directory structure is correct
The text was updated successfully, but these errors were encountered:
Presumably the pyproject.toml needs to be modified to reflect the new module. Doing that by hand (following other packages) gives
(testcontainers-_53phrdA-py3.11) vscode ➜ /workspaces/testcontainers-python (feature/nats) $ poetry lock --no-update
Resolving dependencies... (0.2s)
Because testcontainers depends on nats (*) which doesn't match any versions, version solving failed.
I've never used poetry to create extras/modules so I'm not sure if there is a poetry command I should be executing.
Hello,
I'm working on a new module for https://nats.io/
How does module discovery work?
For instance VSCode test discovery is unhappy with the new module
Thinking this is a VScode issue I tried via just poetry
I think my directory structure is correct
The text was updated successfully, but these errors were encountered: