Closed markdall closed 4 years ago
Thanks for the bug report! We just wanted to quickly acknowledge we received it and we will triage this as soon as we can.
Hi @markdall 👋 Thank you for reaching out. The behaviour you've encountered is intentional because .
are used as structure markers:
app_test.py
file with content taken directly from the unittest docs:import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual("foo".upper(), "FOO")
def test_isupper(self):
self.assertTrue("FOO".isupper())
self.assertFalse("Foo".isupper())
def test_split(self):
s = "hello world"
self.assertEqual(s.split(), ["hello", "world"])
# check that s.split fails when the separator is not a string
with self.assertRaises(TypeError):
s.split(2)
python -m unittest discover -v -s . -p "*test*.py"
, which shows the following in the console:
my-root-folder >> python -m unittest discover -v -s . -p "*test*.py"
test_isupper (app_test.TestStringMethods) ... ok
test_split (app_test.TestStringMethods) ... ok
test_upper (app_test.TestStringMethods) ... ok
Ran 3 tests in 0.000s
OK
Having a file named `app.test.py` throws a wrench in the structure, hence why discovery fails.
I did search so I apologize if this is a dupe and I just missed it. I was following the tutorial here https://github.com/mjhea0/flaskr-tdd when I found that I couldn't get test discovery to work.
Environment data
"python.jediEnabled"
set to; more info #3977): Check checkbox is unchecked, so... Language Server.Expected behavior
It finds the tests.
Actual behaviour
It doesn't find the tests.
Steps to reproduce:
*test*.py
. Bonus: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
)