Individual pytest in pycharm

In pycharm I’ve set pytest to be my default testing framework via file->settings->tools->python integrated tools / Testing

Now when I right click on my test directory I can run all tests using pytest.

However, when I open a python test file and click the play button to run an individual test (eg. run pytest for test_1()), pycharm’s pytest framework is not used and instead the entire file is run as a script.

in PyCharm 2021.1, the first time you right click on the play button it will show an option to run the file as a normal python script. If you right click on the play button a second time this option will change to running that individual test with pycharm.