-
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
unexpected situation while processing a pytest node during test discovery #19804
Comments
@csgehman Can you provide the test code that generated this? also, could you share your test settings? |
The code is not public. Here's a sanitized version of test_baseline.py:
I'm not sure what you mean by "test settings". Here are the
I just noticed the extraneous |
Hello, this looks to be a bug in the test adapter and is likely related to the ongoing buggy behavior on pytest discovery and running in vscode. We are currently work on a rewrite of how pytest works in vscode and hope this rewrite will fix this and similar bugs. The main issue which will be working on is here: #17242, and progress will be updated on this issue. Thank you! |
Are there any known workarounds, I've been wanting to use this feature since it came out but its never been able to discover the tests. |
@plafosse, could you provide more information on your situation specifically? Since it is a general error code I am not sure any workarounds unless I see what more specifically you are running into. Settings and logs would be helpful to diagnose- thanks! |
Hello! We have just finished our testing rewrite and are beginning the roll out to users. I have tested this issue with the re-write and I am no longer reproducing the bug! If you would like to try it yourself, you need to be on vscode insiders and then add this setting to your users |
verification steps same as repro steps:
example for what could be in your test file:
|
The Refresh Tests command does nothing for me. I added the setting to my User settings file. Am I supposed to press the Configure Python Tests button first? There's also a single info log that shows up saying that it's discovering tests, but no trace or debug logs seem to appear after. macOS Edit: I just noticed I didn't enable the pytestEnabled setting. Will see if that fixes it. |
The extension discovered the test in
I'm guessing the usual flow is to press the "Configure Python Tests" button, still? I feel like I took a much more manual approach this time. |
Hi! Sorry for the ongoing confusion. Yes, it will work best to do |
Type: Bug
Behaviour
Expected vs. Actual
Expect the extension to discover pytest test functions. Instead, it reports an "unexpected situation".
Steps to reproduce:
"python.testing.pytestArgs": ["test/unit/test_baseline.py"]
.Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Sanitized Python extension output:
User Settings
Extension version: 2022.14.0
VS Code version: Code 1.71.0 (784b0177c56c607789f9638da7b6bf3230d47a8c, 2022-09-01T07:25:38.437Z)
OS version: Darwin x64 21.6.0
Modes:
Sandboxed: No
Remote OS version: Linux x64 3.10.0-957.1.3.el7.x86_64
A/B Experiments
The text was updated successfully, but these errors were encountered: