-
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
Unittest id parsing fails when using testscenarios
#17641
Comments
@bigjools Can you share your project layout? or a minimal repro? |
I can't share my private repo but I'll describe the layout here and see if I can reproduce with another public one I have on Monday. The tree looks like this:
And I have |
@bigjools |
Huh interesting! Test discovery works with that pattern but not running them. Using a shell path works fine for both. Ok I guess you can turn this ticket into a "print a sensible error message". Thank you! |
Actually I spoke too soon. If I use If I use Running the tests from the CLI with |
Here's an example also of what the sidebar is doing. (This is a public project of mine so please feel free to test with it https://github.com/juledwar/soufi) |
@karthiknadig Hi, let me know if I gave you enough info on this? Thanks. |
@karthiknadig Hi again, please let me know if you need any more info. |
@bigjools Sorry about the delayed reply. Yes, I have enough info for this. |
testscenarios
I thought I'd give an update on this: Good news: The latest vscode seems to detect the tests correctly!
Additionally, I cannot recreate in a public repo that I have but in my private repo I get an additional error about two tests having the same ID:
Also it just caught my eye that the log datestamp is saying February instead of March. |
I'm not sure if anything has been changing lately, but thought I'd mention I am still completely unable to run any tests in any projects that use |
Hello! We have just finished our testing rewrite and are beginning the roll out to users. If you are able, it would be very helpful to know if your issue still exists on the rewrite! To use the rewrite yourself just add Thanks! |
Hi, thanks for the details, much appreciated. I am sadly unable to get even this far now as I think a new bug has been introduced in recent releases. I have a 3rd party library which has the same name as one of my sub-modules in my main code and while my CLI test runner has no problem with this, the test discovery in vscode sees it as a circular import as I think it tries to import itself rather than the 3rd party module. I am not sure what to do, is this a new bug or did I misconfigure? Previously it has at least discovered all my tests, even if the testscenarios-based ones were incorrect. Many thanks. |
Hi thanks for reaching out! Could you include a brief layout of your project and your logs from the |
I've included a redacted log below (the env vars were possibly revealing things I don't want in a public forum). The project is called And then there's a 3rd party library called It's obvious at least to me that test discovery is not considering the rest of the venv (which lives in
|
@karrtikr, thoughts on the environment setup issue here? |
Yes, a separate issue would be better to track that. |
I'm trying to report using vscode since I can't open here directly any more, and it's doing nothing when I hit the "Create on Github" button. :( Do you have admin powers to duplicate this one? |
created this issue: #23239 |
Thanks @karthiknadig . Was that testscenarios pointer enough to help? Sorry I can't do much more at the moment I am very short on free cycles. |
Fixes #17641 --------- Co-authored-by: eleanorjboyd <[email protected]>
Hello! We have put in a fix for this issue and it should now be working! If you could try it on the newest version of the python extension nightly pre-release that would be great so we know if it works! Happy coding! |
Hi! I started looking into the python path ordering issue and am not able to repro it on my side- I tried with both mac and windows and am seeing the path ordering stay the same minus the additions we make to the path for the plugin etc. @karthiknadig any ideas here why it could be happening if I am not able to repro? @bigjools are you able to send a minimal repro where you experience the path re-order issue as this could help me dig in. If you send the whole workspace folder as a zip I can also look through your settings. |
We can discuss the path ordering here: #23239 I am suspecting this has to do with activation experiment |
How do I get the nightly pre-release? I tried the "pre-release" option in the extension but it's not fixed there. |
We are actually having some delays getting the newest changes out due to some other release issues. I will reach out when the changes are on the most recent pre-release and then you should be able to see them on your side. Thanks! |
@eleanorjboyd Currently it only happens to me on a very large, very private repo, so I will have to see if I can make a smaller example somehow. It only shows up as a problem when I have modules that are the same name as 3rd party ones. |
Karthik also has some guesses on the path ordering so no worries on the minimal repro- I can reach out later if I need it later. Thanks! |
Hi! This should now be out on insiders- sorry for the delay! |
@eleanorjboyd I'm not familiar with the different types of release, is that the same as the pre-release setting in the extension? It has not updated beyond v2024.5.11021008 so far. |
You need version extension 2024.5.11141012, for that you need VS Code Insiders. |
Are there verification steps for this issue? |
|
Confirming this is fixed, thank you very much, this is going to make a huge difference. |
Fixes microsoft#17641 --------- Co-authored-by: eleanorjboyd <[email protected]>
Fixes microsoft/vscode-python#17641 --------- Co-authored-by: eleanorjboyd <[email protected]>
Fixes microsoft/vscode-python#17641 --------- Co-authored-by: eleanorjboyd <[email protected]>
Fixes microsoft/vscode-python#17641 --------- Co-authored-by: eleanorjboyd <[email protected]>
Environment data
python.languageServer
setting: pylance[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behaviour
Clicking "Run Test" on a test should run it.
Actual behaviour
An error is shown in the Python log and the test is not run (see log below).
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: