You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ To execute it::
79
79
========================== 1 failed in 0.04 seconds ===========================
80
80
81
81
82
-
Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started <https://docs.pytest.org/en/stable/getting-started.html#our-first-test-run>`_ for more examples.
82
+
Thanks to ``pytest``'s detailed assertion introspection, you can simply use plain ``assert`` statements. See `getting-started <https://docs.pytest.org/en/stable/getting-started.html#our-first-test-run>`_ for more examples.
:ref:`subtests <subtests>` are an alternative to parametrization, useful in situations where the parametrization values are not all known at collection time.
4
+
5
+
**Example**
6
+
7
+
.. code-block:: python
8
+
9
+
defcontains_docstring(p: Path) -> bool:
10
+
"""Return True if the given Python file contains a top-level docstring."""
Each assert failure or error is caught by the context manager and reported individually, giving a clear picture of all files that are missing a docstring.
21
+
22
+
In addition, :meth:`unittest.TestCase.subTest` is now also supported.
23
+
24
+
This feature was originally implemented as a separate plugin in `pytest-subtests <https://github.com/pytest-dev/pytest-subtests>`__, but since then has been merged into the core.
25
+
26
+
.. note::
27
+
28
+
This feature is experimental and will likely evolve in future releases. By that we mean that we might change how subtests are reported on failure, but the functionality and how to use it are stable.
0 commit comments