diff --git a/doc/api_reference.rst b/doc/api_reference.rst index 30635b7..966ea16 100644 --- a/doc/api_reference.rst +++ b/doc/api_reference.rst @@ -153,6 +153,28 @@ API Reference DEPENDS lib1 lib2 ) + The Python files containing :term:`Pytest` tests can also be explicitly + set as dependencies, ensuring that the target rebuilds whenever these files + are modified:: + + pytest_discover_tests( + ... + DEPENDS + /path/to/test_foo.py + /path/to/test_bar.py + ) + + For convenience, you can use the `GLOB_RECURSE + `_ + command to dynamically gather all test files:: + + file(GLOB_RECURSE test_files "/path/to/tests/*.py") + + pytest_discover_tests( + ... + DEPENDS ${test_files} + ) + * ``BUNDLE_TESTS`` Indicate whether Python tests should be bundled under a single diff --git a/doc/release/release_notes.rst b/doc/release/release_notes.rst index f354b72..7485b7d 100644 --- a/doc/release/release_notes.rst +++ b/doc/release/release_notes.rst @@ -4,6 +4,14 @@ Release Notes ************* +.. release:: Upcoming + + .. change:: changed + + Updated the :ref:`api_reference` section to include details on how ``DEPENDS`` + can be used to ensure the target rebuilds whenever the Python files containing + :term:`Pytest` tests are modified. Thanks :github_user:`AmeyaVSingh`! + .. release:: 0.11.2 :date: 2025-01-18