-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Description
Hello,
I've encountered a little bug recently in the "Tests" tab. I am not 100% sure that the bug is related to vscode or to the python extension. see below
Environment:
- VSCode Version: 1.34.0
- OS Version: Windows_NT x64 6.1.7601
- Python extension version : 2019.6.24221
- settings.json :
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true
}
Bug :
When a test file contains an upper letter, it is not displayed properly in the test tab. After running if passed or failed, it is displayed with a "grey question mark".
Steps to Reproduce:
- Create an empty project (note : use a conda environment where pytest is installed)
- Create a "tests" folder
2.1 Create atest_working.pyfile
import pytest
def test_this_one_works():
assert 1==1
2.2 Create a test_NotWorking.py file with the same code
import pytest
def test_this_one_works():
assert 1==1
-
In the
Testtab of vscode, runDiscover Tests
If everything ran properly, you should see the following architecture :
-(?) tests- (?) test_notworking.py (with lower case!!!)
- (?) test_this_one_does_not_work
- (?) test_working.py
- (?) test_this_one_works
- (?) test_notworking.py (with lower case!!!)
-
In the
Testtab of vscode, runRun All Tests.
Now I have :
-(green tick ok) tests- (?) test_notworking.py <- BUG - EXPECTED BEHAVIOUR : should have a green tick and have name in upper case
- (?) test_this_one_does_not_work <- BUG - EXPECTED BEHAVIOUR : should have a green tick and have name in upper case
- (green tick ok) test_working.py (with lower case!!!)
- (green tick ok) test_this_one_works
- (?) test_notworking.py <- BUG - EXPECTED BEHAVIOUR : should have a green tick and have name in upper case
Remarks :
- the tests seem to be ran whatever is displayed (the bug only concerns the user interface) : indeed in the bottom line (where my python version and my environment are shown), I see an icon "two tests passed".
- when i run
pytest testsin the command line, everything is fine.
Conclusion :
This bugs is not critical at all since it only concerns te UI, but in my old projects I can't see the tests in the UI (while it used to work perfectly fine few weeks ago). I definitely do not want to change the names of the scripts (the tests scripts are a mirror of the scripts names of my project).
Any hope this would be easy to fix?
Many thanks for reading and any further help !
Galileo