-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adding --cov-fail-under=100 on adopts config will provoque discovery failure when coverage under 100% #11929
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
Comments
Duplicate of #11729, please upvote it to help us prioritize it. Thank you! |
@kimadeline I'm not sure that this is actually a duplicate of #11729 I've run into this too now, where I specify the pytest setting What happens is the pytest execution process fails because code coverage during discovery doesn't yield nearly the same results as when the tests actually run.
When running tests normally, this same package gets 100% code coverage, and the pytest process exits successfully. |
Same observation: I don't think this is a duplicate. Adding |
Adding |
Same as #15978 (comment): After discussing it with the team, we do not want to add |
Uh oh!
There was an error while loading. Please reload this page.
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): Enabledpython.languageServer
setting: MicrosoftExpected behaviour
Tests are discovered
Actual behaviour
Error message is shown with:
Steps to reproduce:
file: test_simple.py
Running this code with pytest should result in 75% code coverage (4 statements, 3 covered).
Logs
FAIL Required test coverage of 100% not reached. Total coverage: 75.00% ============================ no tests ran in 0.65s =============================
Traceback (most recent call last):
File "~/.vscode/extensions/ms-python.python-2020.5.80290/pythonFiles/testing_tools/run_adapter.py", line 22, in
main(tool, cmd, subargs, toolargs)
File "~/.vscode/extensions/ms-python.python-2020.5.80290/pythonFiles/testing_tools/adapter/main.py", line 100, in main
parents, result = run(toolargs, **subargs)
File "~/.vscode/extensions/ms-python.python-2020.5.80290/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 44, in discover
raise Exception("pytest discovery failed (exit code {})".format(ec))
Exception: pytest discovery failed (exit code 1)
The text was updated successfully, but these errors were encountered: