Skip to content

Commit c44862c

Browse files
authored
Hide SubTests.test() from tracebacks (#131)
1 parent 732064c commit c44862c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGELOG
22
=========
33

4+
UNRELEASED
5+
----------
6+
7+
* Hide the traceback inside the ``SubTests.test()`` method (`#131`_).
8+
9+
.. _#131: https://github.com/pytest-dev/pytest-subtests/pull/131
10+
411
0.12.1 (2024-03-07)
512
-------------------
613

src/pytest_subtests/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ def test(
224224
msg: str | None = None,
225225
**kwargs: Any,
226226
) -> Generator[None, None, None]:
227+
# Hide from tracebacks.
228+
__tracebackhide__ = True
229+
227230
start = time.time()
228231
precise_start = time.perf_counter()
229232
exc_info = None

0 commit comments

Comments
 (0)