I have installed pytest using pip. Sample code below
import pytest
def example():
assert 9 == 9
My settings.json file looks like this
{
"python.testing.pytestArgs": [
"."
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"python.testing.pytestEnabled": true
}
I keep getting no tests ran in terminal when using the pytest filename.py command.
Python version : 3.9.1 pytest version : 6.2.2.
Anyone have any ideas?
Update: Jason's answer below is what worked. The problem was the naming of the file and methods. File name needed to end in '_test.py' for vscode to run tests and functions needed to start with 'test_' for both terminal and vscode to run.