-
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
Error parsing test ids containing paths during pytest test discovery #18622
Comments
Hi @davidpcaldwell, thank. you for reaching out! This is a known shortcoming of our current code for parsing test data, we will address this as part of #17242. |
I also have an issue with failing pytest discovery that produced the following message:
I figured I shouldn't create a new issue if there is one with a similar title. |
Hi @jmmshn, Since the root cause of your problem is unclear, please open a separate issue with repro steps. Thanks! |
Looks like release of the new testing implementation is imminent. #17242 (comment) I can recheck this test case when I have access to the new implementation. |
Hello! Thank you for reaching out, you are correct in that we have just finished our testing rewrite and are beginning the rollout to users. To try this yourself you need to be on vscode insiders and then add this setting to your users |
Hi @eleanorjboyd, I don't think I can move to Insiders given the constraints I'm under, though I'll think harder about it (is there documentation on how to switch back if needed?). In the meantime, what the process for landing this experimental code (presumably behind the setting) on the stable build? |
Hi! So insiders is a whole different application (so you can download it along side vscode stable). We will release the experiment to stable this week so once that release comes out (likely thursday) you should be able to try it on stable. Thanks! |
OK, so I can confirm (so far) that when combined with my patches, the new parsing works with my test case. Next I'll remove my patches and see whether it still works with more of an out-of-the-box setup. |
Great! Yes, let me know without your patch if it works. Thanks for trying this and keeping me updated |
Hi @eleanorjboyd -- we've got multiple users of VSCode (some of whom are not VSCode nerds like me). We're discussing whether and when we can remove our (ugly) patch to the Python extension that worked around this, and gathering data about what the current behavior looks like. I see that with 1.81, 25% of users have been opted into the new test adapter. Is there a way we can see whether a particular installation is in the 25% or not? Thanks, and we'll keep working to figure this out and let you know. Update for other readers: actually, found my answer in the FAQ. @eleanorjboyd: never mind. :) |
Hi @davidpcaldwell, sorry it has been a minute! Each user can check if they are enabled through the steps below, I don't think there is a way to check for someone else's machine id. The rewrite is now at 50% of all stable users and we will be bumping it up soon. Are there any outstanding problems you see? Just wanted to check in and see how things were looking. Thanks! You can check if you have the rewrite enabled by setting your log level to trace, via the |
closing due to inactivity, please comment if you have more you want to discuss and I can reopen, thanks! |
Issue Type: Bug
Behaviour
Expected vs. Actual
Expected: Extension successfully discovers tests when clicking the test icon
Actual: Error occurs. The error is of this form (I've removed information I am not sure I can disclose), and occurs on line 184 of
pythonFiles/testing_tools/adapter/pytest/_pytest_item.py
:So the general issue is that
fullname
contains the path of the file containing the test, andtestfunc
does not, so the check fails and raises theshould_never_reach_here
exception.Simply changing the
raise
statement on line 185 topass
fixes the problem for me; all tests, including those authored under the library cited below, are discovered successfully, can be run, etc.Steps to reproduce:
Diagnostic data
python.languageServer
setting: PylanceUser Settings
Extension version: 2022.0.1814523869
VS Code version: Code 1.64.2 (f80445acd5a3dadef24aa209168452a3d97cc326, 2022-02-09T22:00:58.347Z)
OS version: Darwin x64 21.3.0
Restricted Mode: No
Remote OS version: Linux x64 5.10.76-linuxkit
A/B Experiments
The text was updated successfully, but these errors were encountered: