I want to write my test using pytest and to be able to run them (individually) in IntelliJ. I have pytest installed, along with (obviously) Python plugin for the IDE.
My test file (tests/test_main.py) looks like that:
from app.main import sum_numbers
def test_sum_numbers():
assert sum_numbers(1, 2) == 3
assert sum_numbers(10, 20) == 30
assert sum_numbers(1, 2, -3) == 0
Running pytest from terminal works perfectly. But IntelliJ seems to treat this as a regular file, there are no "run" icons before the declarations. Also, running the file from the IDE does nothing, as it is not treated as a test file.
What can I do?