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/unit/some_test_file.py

From: stackoverflow.com/q/34833327