File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ API Reference
2323 [INCLUDE_FILE_PATH]
2424 [STRIP_PARAM_BRACKETS]
2525 [BUNDLE_TESTS]
26+ [EXTRA_ARGS arg1 arg2...]
2627 )
2728
2829 The options are:
@@ -184,10 +185,24 @@ API Reference
184185 Bundled tests generally run faster because :term: `Pytest ` can use
185186 caching and :term: `fixtures <fixture> ` with a broader scope.
186187
188+ * ``EXTRA_ARGS ``
189+
190+ List of extra arguments to pass on the :term: `Pytest ` command line for
191+ each test case::
192+
193+ pytest_discover_tests(
194+ ...
195+ EXTRA_ARGS "--capture=no" "--cmdopt=demo"
196+ )
197+
198+ .. seealso ::
199+
200+ `Pytest Command-Line Flags
201+ <https://docs.pytest.org/en/stable/reference/reference.html#command-line-flags> `_
202+
187203 .. note ::
188204
189205 This function works similarly to the `gtest_discover_tests
190206 <https://cmake.org/cmake/help/latest/module/GoogleTest.html#command:gtest_discover_tests> `_
191207 function, which creates :term: `CTest ` tests for each :term: `GTest ` tests
192208 discovered within a single C++ executable test file.
193-
Original file line number Diff line number Diff line change 44Release Notes
55*************
66
7+ .. release :: Upcoming
8+
9+ .. change :: changed
10+
11+ Added ``EXTRA_ARGS `` option to the :func: `pytest_discover_tests `
12+ function, allowing custom arguments to be passed to the :term: `Pytest `
13+ command when executing each test. Thanks :github_user: `AmeyaVS `!
14+
715.. release :: 0.11.4
816 :date: 2025-01-29
917
You can’t perform that action at this time.
0 commit comments