["python","pytest"]
How to test single file under pytest

How do you test a single file in pytest? I could only find ignore options and no "test this file only" option in the docs. Preferably this would work on the command line instead of setup.cfg, as I would like to run different file tests in the ide. The entire suite takes too long.
simply run pytest with the path to the file something like pytest tests/test_file.py Use the :: syntax to run a specific test in the test file: pytest test_mod.py::test_func Here test_func can be a test method or a class (e.g.: pytest test_mod.py::TestClass). For more ways and details, see "Specifying which tests to run" in the docs.