These options are only considered when no directories were provided in the command. When both testpaths and watchpaths are provided then the former are provided to pytest while the latter are watched. When only the testpaths are provided then these are both watched and passed to pytest. When only the watchpaths are provided then these paths are watched but not passed to pytest, allowing it to pick up the testpaths provided in the [pytest] section.
These options are only considered when no directories were provided in the command. When both
testpaths
andwatchpaths
are provided then the former are provided to pytest while the latter are watched. When only thetestpaths
are provided then these are both watched and passed to pytest. When only thewatchpaths
are provided then these paths are watched but not passed to pytest, allowing it to pick up thetestpaths
provided in the[pytest]
section.