Open Ch1lled opened 2 years ago
@Ch1lled Thank you for the issue! Yes, in 0.7.0 I've updated the behavior to match default pytest capturing (related to #245). The output will be shown on click for failed test
To enable full capturing you can add "--override-ini=junit_logging=all"
to "python.testing.pytestArgs"
setting or, if you use pytest ini file, junit_logging=all
to that file.
Let me know if this helps!
That's exactly what I needed, thanks a lot!
Adding a setting causes another issue but looks like test runs fine:
VSCode ver. 1.59.0
Ok, the default settings for unittest were broken in the Python extension. I'll see how to fix this, but as a quick fix, I can suggest adding "python.testing.unittestArgs": []
to the settings. Let me know if this helps!
Nope, still has an error.
@Ch1lled I meant to set this directly in JSON 🙂 If you're using UI, then just remove all items from the list
Oh, didn't get it) After removal there is no more error, thanx, I appreciate your help a lot.
for unittest
I have add "python.testing.unittestArgs": [] in settings.json and remove all Item in settings but output still not showing in Test Explorer
VS Code version: 1.59.0 (system setup) Python Test Explorer for Visual Studio Code version: v0.7.0
settings.json: { "python.testing.unittestArgs": [], "python.testing.pytestEnabled": false, "python.testing.nosetestsEnabled": false, "python.testing.unittestEnabled": true }
@k870611 The recommendation to set "python.testing.unittestArgs": []
is only when tests are executed with pytest and it does not affect output. For unittest I actually recommend setting python.testing.unittestArgs
with appropriate values.
For unittest, there would be no output if a test is executed successfully and there is no output to standard output (e.g. print
statements). To verify you can run python -m unittest discover <your command line args for start directory and pattern>
and see if there would be any additional output (except from unittest).
If it does not resolve your problem, I can suggest creating a new issue and add additional details like screenshots, python version, and perfectly a reproducable example.
Sorry I don't know does it is cause by myself (like wrong config or....) but In cmd and PYTHON is have output
CMD:
PYTHON
but not in Test Explorer
@k870611 Test outputs are not aggregated, can you try clicking on a specific test that should contain output?
In 0.6.8 there was the - Captured Out - section in Output where all print() results was shown. It's gone in 0.7.0 so how to browse prints now?
And also why there are no more logs for successful tests?![image](https://user-images.githubusercontent.com/58484496/128391852-e8639bf8-ec3b-4839-8237-3d5c0dc1bb40.png)