Skip to content

Commit aa35e66

Browse files
fix: trim test report (#875)
This commit removes unused properties for tests which passed. This PR substitutes #873 PR. Co-authored-by: Harshil Gajera <[email protected]>
1 parent 8256d2e commit aa35e66

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pytest_splunk_addon/splunk.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,16 @@ def update_recommended_fields(model, datasets, cim_version):
835835
return update_recommended_fields
836836

837837

838+
@pytest.hookimpl(hookwrapper=True)
839+
def pytest_runtest_makereport(item):
840+
"""
841+
Show user properties in report only in case of failure
842+
"""
843+
output = yield
844+
if output.get_result().outcome == "passed":
845+
item.user_properties = []
846+
847+
838848
@pytest.fixture(scope="session")
839849
def docker_ip():
840850
"""Determine IP address for TCP connections to Docker containers."""

0 commit comments

Comments
 (0)