Is there a way to select pytest
tests to run from a file?
For example, a file foo.txt
containing a list of tests to be executed:
tests_directory/foo.py::test_001
tests_directory/bar.py::test_some_other_test
Or, is there a way to select multiple tests, having no common pattern in test name, from different directories with pytest?
pytest -k <pattern>
allows a single pattern.
One option is to have a pytest.mark
against each test, but my requirement is to run different combination of tests from different files.
Is there a way to specify multiple patterns and a test file name for each pattern?
Or
Is there a way to specify the exact test paths in a file and feed that file as an input to pytest
?
Or
Is there a hook function that can be utilized for this purpose?