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.
Add to file “pyproject.toml” in project top-level directory:
[tool.pytest.ini_options]
norecursedirs = subprojects .* build dist CVS _darcs {arch} *.egg venv