Skip to content

Commit bfa5900

Browse files
author
Cody D'Ambrosio
committed
add pytest-subtests support
Handle subtest names cleanly when defining test description, to avoid duplicate test cases in generated TAP file.
1 parent 5aa918d commit bfa5900

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/pytest_tap/plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ def pytest_runtest_logreport(self, report: pytest.TestReport):
5757
return
5858

5959
description = str(report.location[0]) + "::" + str(report.location[2])
60+
if hasattr(report, "sub_test_description"):
61+
# Handle pytest-subtests plugin
62+
description += report.sub_test_description()
63+
6064
testcase = report.location[0]
6165

6266
# Handle xfails first because they report in unusual ways.

0 commit comments

Comments
 (0)