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
VSCode 'Run tests' for Python pytest reports warning for junit_family #9709
Comments
I have tried the workaround you suggested with no avail. Can it be that pytest.ini file is ignored? |
@lioramilbaum are you sure pytest is picking it up? You can tell from the second line of output, it should look like this (in yellow): I can't help you debug this further, but the pytest docs are here: https://docs.pytest.org/en/latest/customize.html#initialization-determining-rootdir-and-inifile |
I'm seeing the same problem, running pytest from the command line throws no warning but from inside vscode I get annoying complaints about junit. |
In order not to create additional files, and since vscode-python is the culprit here, an alternative workaround is to add:
to your configuration file. Obviously, vscode-python should be doing this, specially because eventually the default will change and the output format may be unreadable for the extension. |
Thanks @memeplex - this worked for me |
Sounds very good solution. As I'm not sure which /where the configuration might be placed/called. |
You can put it in Mine looks like this
|
i'm still worried about the fact that vscode doesn't find the .ini when the command line does. This sounds like not the same pytest is being run and I don't want to copy all my settings over to vscode just to make it work. |
We are going through old issues and we noticed that no one from the team had replied to this issue. I want to apologize for the oversight and to let you know that the issue was reviewed by the team and triaged (as shown by the labels applied to this issue). |
I am using
I do see |
This is fixed 1d15bbf |
Thanks!!! |
Environment data
VS Code version:
Version: 1.41.1 (user setup)
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T14:58:56.166Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18363
Extension version (available under the Extensions sidebar):
Name: Python
Id: ms-python.python
Description: Linting, Debugging (multi-threaded, remote), Intellisense, Jupyter Notebooks, code formatting, refactoring, unit tests, snippets, and more.
Version: 2020.1.58038
Publisher: Microsoft
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-python.python
OS and version: Windows_NT x64 10.0.18363
Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
Relevant/affected Python packages and their versions: pytest 5.3.2
Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): checkedExpected behaviour
As per pytest-dev/pytest#6179 , if you call pytest withOUT --junitxml, there should be no warning related to junit_family.
Actual behaviour
If I call pytest from Powershell commandline, output is as expected. However if I use 'Run All Tests' in VSCode, I get the following warning:
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
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)As a workaround, I will add
junit_family=legacy
in my own pytest.ini to silence the warning.The text was updated successfully, but these errors were encountered: