Open keestux opened 2 weeks ago
A work around is to comment out everything in get_pytest_options.py
, or to install python3-pytest
.
Of course the code in get_pytest_options.py
should be able to handle the absence of _pytest
.
import sys
try:
from _pytest.config import get_config
c = get_config()
c.parse(sys.argv)
print(f"Python classes: {c.getini('python_classes')}")
print(f"Python files: {c.getini('python_files')}")
print(f"Python functions: {c.getini('python_functions')}")
except ModuleNotFoundError:
pass
The logic currently expects an exception if pytest isn't installed. I suppose we could change the logic and sys.exit(1) instead or something.
Can you show me where and how this get_pytest_options.py
is used?
Sorry but it's closed source. The logic is here for somebody else to possibly fix: https://github.com/microsoft/pyrx/blob/41c31cdef2af8e635f05fe78826dfe27d1f38aef/packages/pylance-internal/src/pytest/queryEngine.ts#L36
It just runs the script. If it fails it uses the defaults for pytest.
Environment data
Code Snippet
...
Repro Steps
Just start
code
and look at output ofjournalctl -f
.Logs
It seems to have started with 2024.3.2
Excerpt from
journalctl