The pattern used to discover the Pytest version is not working above version 5.
if (_version MATCHES "pytest version ([0-9]+\\.[0-9]+\\.[0-9]+),")
set(PYTEST_VERSION "${CMAKE_MATCH_1}")
endif()
The version command option has changed between Pytest v5 and v6:
# v5
> pytest --version
This is pytest version 5.0.0, imported from /usr/local/lib/python3.9/site-packages/pytest.py
# v6
> pytest --version
pytest 6.0.0
The pattern used to discover the Pytest version is not working above version 5.
The version command option has changed between Pytest v5 and v6: