Comments (2)
@broganrossae We only do that in the logs, actual execution uses full path that you provide. Would it be possible to share the error that you see when discovery fails?
from vscode-python.
I'm working on repositories with non-standard layouts, and because of that I need to set the PYTHONPATH env var to help pytest find the correct modules. Therefore the errors I get are ModuleNotFoundError
s.
In a separate shell I ran the example pytest commands (in the same working dir). One with ~ and one with the absolute path to user's home directory. When using ~ they failed, but the absolute path worked, which is what makes me think the plugin isn't using ~ only in logs.
Error stack example with truncated/redacted stuff
2024-06-03 09:11:07.154 [info] ============================= test session starts ==============================
platform darwin -- Python 3.11.9, pytest-7.4.4, pluggy-1.5.0
2024-06-03 09:11:07.162 [info] rootdir: /Users/user.name/repos/repoName
configfile: pytest.ini
plugins: mock-3.11.1
2024-06-03 09:11:07.506 [info] collected 28 items / 4 errors
<Package unit>
<Module test_file_one.py>
<Function test_one>
<Function test_two>
<Function test_three>
2024-06-03 09:11:07.533 [error] pytest test discovery error for workspace: /Users/user.name/repos/repoName
_pytest.nodes.Collector.CollectError: ImportError while importing test module '/Users/user.name/repos/repoName/tests/unit/test_another.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/unit/test_EXT03_05.py:11: in <module>
import EXT03_05_prepareSendFiles as preset
presets/EXT03_05_prepareSendFiles.py:9: in <module>
import EXT03_00_config as config
E ModuleNotFoundError: No module named 'EXT03_00_config'
Check Python Test Logs for more details.
2024-06-03 09:11:07.535 [info] =========================== short test summary info ============================
ERROR tests/unit/test_another.py
!!!!!!!!!!!!!!!!!!! Interrupted: 4 errors during collection !!!!!!!!!!!!!!!!!!!!
==================== 28 tests collected, 4 errors in 0.38s =====================
2024-06-03 09:11:07.574 [error] Subprocess exited unsuccessfully with exit code 2 and signal null on workspace /Users/user.name/repos/repoName.
2024-06-03 09:11:07.574 [error] Subprocess exited unsuccessfully with exit code 2 and signal null on workspace /Users/user.name/repos/repoName. Creating and sending error discovery payload
2024-06-03 09:11:07.574 [error] pytest test discovery error for workspace: /Users/user.name/repos/repoName
The python test process was terminated before it could exit on its own, the process errored with: Code: 2, Signal: null for workspace /Users/user.name/repos/repoName
from vscode-python.
Related Issues (20)
- Test web issue report
- Environments HOT 1
- Python 2.7 should not be reported by Native Locator
- Ensure base environments are named `base` in the quick pick when using Native Locator
- Python Interpreter not working HOT 2
- Python REPL conflicts with Jupyter IW HOT 1
- Create tests for Python REPL
- Python REPL should omit empty output HOT 4
- Have smart send work with native REPL
- Support interrupt for Python REPL-Windows
- Rename existing Start Python REPL to Terminal REPL HOT 1
- python.execInREPL steals shift+enter HOT 3
- Test Explorer duplicates tests when test name is same and parameterized fixture is shared across multiple classes. HOT 1
- index1.py HOT 2
- Load signal on test discovery
- Update tests for testController.ts
- 7 uncaught HOT 1
- [Feature] new lint rule to require a comment #. at end each python block. HOT 1
- shift+enter does not always execute the IW input box HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-python.