python-cmake / pytest-cmake

Pytest module for CMake
https://python-cmake.github.io/pytest-cmake/
MIT License
25 stars 0 forks source link

Pytest version is not discovered for pytest over v5 #6

Closed buddly27 closed 1 year ago

buddly27 commented 1 year ago

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