-
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
Support an output stream from the testing adapter script. #6594
Comments
@DonJayamanne, we talked about this a while back, but I couldn't find any issue about it... |
What you've suggested is exactly what we do with unit tests in Python. and I agree with the benefits. It's a more structured and easier solution. This was way we run tests exactly the same way the users do. (Instead of us launching pytest using the API, modifying paths, args, etc) |
Does this mean that pytest in vscode currently captures stdout and not show it in the test runner? |
No, it is displayed in the test runner. |
Thanks.. we are seeing similar issues in VS. For now i'm making a change to optionally write results to a file so that we can still get partial results. |
I have updated VSCode, but the test discovering still fails on all my projects (#8123). I'm quite surprised that the issue hasn't been resolved. Can I fix it somehow temporarily? Do you need more information on the issue? Here is my logs:
|
@luabud, any ideas on timeline? |
We're hoping to get to it soon but no ETAs yet. |
@luabud , is there a workaround? All python extension features for testing in VSCode literally don't work at the moment. Should I just install another extension (if there is any) and forget about |
@awav I'm so sorry for not giving workaround options 😞 According to what you said here: #8123, the error that is being thrown is this: If you suppress the warning, test discovery won't fail. So what you can do is create a .env file with the following content: Then open the settings.json file under the .vscode folder in your workspace and add the setting below: Reload the window and you should be able to see your tests in the test explorer: |
@luabud Thanks a lot!
|
@awav Oops, sorry. I assumed you didn't have a .code-workspace file. Anyway, yes please do a new issue for that case 😊 I don't think you should need to add the full path to the .env file in the setting, so it does sound like an issue. Thank you for giving more info! |
Is there any update on this issue? |
Hello! I wanted to update everyone since this has been a long-running issue. We are currently work on a rewrite of how pytest works in vscode and moving to the plugin style. The main issue which will be working on is here: #17242, and progress will be updated on this issue. Please reference this main issue for updates but I will also try and follow up here as necessary. Thank you! |
Hello! We have just finished our testing rewrite and are beginning the rollout to users. If you would like to try it yourself, you need to be on vscode insiders and then add this setting to your users |
Stoked about this. Trying it out and every time I run my test I see a list of ALL the tests. E.g.
This makes it hard to find the output, especially because any time I change a file, it reruns and obscures the logs. Any setting or anything I can change on my side? |
@dandiep glad it worked! Have you tried adding |
Currently the pytest adapter captures the pytest stdout (and hides it unless there's an error) and write the JSON results to stdout. The extension then parses this output and incorporates the results.
An alternate approach would be to connect a socket to the script and push results out over that socket. This would add complexity, but provides a number of benefits:
The text was updated successfully, but these errors were encountered: