-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Test discovery fails with " [n [Error]: & was unexpected at this time." #19285
Comments
@mathieuackermann Can you share details about the tests that you are running? Is there by chance any particular test with |
@karthiknadig no, I'm not using this character in any of the tests. Besides, all the tests are correctly discovered and run without issue if I run
|
@mathieuackermann Can you run this from the terminal and share the output?
|
@karthiknadig here is the output:
|
Sorry, that Can you try with this:
|
Thanks! This latest command ran without error and produced a lot of output, listing all the tests in the terminal in JSON format. However the tests are still not displayed in the test explorer. How can I workaround that bug? |
@mathieuackermann Can you share the output? something there must be causing this to happen. |
The output goes beyond the cache limit of the terminal, as there are many test combinations. Below is just a sample:
|
I see, try this, it should put the content into a file.
Please share the file pytestdata.json. |
Here it is (added .txt because GitHub refused to upload .json) |
@mathieuackermann Thanks for the data file. I looks fine, so I think the problem is elsewhere. @karrtikr It seems like we are probably not using the right command here to invoke python. I suspect that we are using Powershell style command for something that is running on cmd? I will need your input on this. |
@karthiknadig I'm experiencing something similar. With Nushell, a new terminal instance tries to activate the selected venv with The correct command here should be Weirdly, when actually using pwsh it truncates the activation command: Do you think this falls under the same umbrella or should I start a new issue? |
@karthiknadig gotcha. thanks. |
Issue solved. For some reason, I had an obscure registry entry causing a crash of cmd.exe on startup, as described on this link: https://stackoverflow.com/questions/58849884/cmd-exe-closes-immediately-unusual-line-in-autorun-registry-entry |
Issue Type: Bug
Steps to reproduce:
-Click on test beker
-Test discovery fails with "Error discovering pytest tests (see Output > Python)"
-In "Output", the following error is reported:
The same error occurs every time I save a Python file (as the test discovery runs automatically).
Pytest works fine when called directly from the terminal. Only the test explorer creates this error.
Expected output:
-Tests are correctly discovered
Extension version: 2022.8.0
VS Code version: Code 1.68.0 (4af164ea3a06f701fe3e89a2bcbb421d2026b68f, 2022-06-08T11:44:16.822Z)
OS version: Windows_NT x64 10.0.22000
Restricted Mode: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: