I am trying to use pytest to run some tests. My package contains a setup.cfg file where I've stated all the pytest options
[tool:pytest]
addopts =
--verbose
unit
as it is visible I've added the unit directory to find the test files. This works fine and all the tests from the directory get executed during the normal build process.
Actual Problem -
Now I have another directory integ where I have my integration tests which I want to run sometimes but do not want them as a part of my build process. I have created another command line option to run my integ tests but I am not able to figure out how to provide the file set correctly for the same
I've tried pytest --ignore=unit integ through command line but it runs all my tests from unit as well as integ. I want to run the tests present in integ only and ignore the tests from unit. What am I missing here?
[update]
When I run pytest --ignore=unit/test_file.py integ it ignores the tests in test_file but when I use pytest --ignore=unit/*.py integ it says no matches found: --ignore=test/*.py
Thanks