Suppose you have multiple files say test_sample1.py, test_sample2.py. To run all the tests from all the files in the folder and subfolders we need to just run the pytest command.
This will run all the filenames starting with test_ and the filenames ending with _test in that folder and subfolders under that folder. To run tests only from a specific file, we can use py.test <filename>
I hope this will help you.