Pytest ignoring Meson subprojects

Meson projects may contain Python code, including Meson subprojects. However, the Meson subproject code may not be relevant to the top-level Meson project Python code. Then, Pytest Python test suites may fail when the subprojects/ directory tree is searched and unwanted tests are run.

Ignore directories with Pytest

While this example is for Meson subprojects, it is obviously applicable to many other Python projects.

Create pytest.ini file at the top-level project directory, containing:

[pytest]
norecursedirs = subprojects .* build dist CVS _darcs {arch} *.egg venv