Skip to content

Commit

Permalink
fix: trim test report (#875)
Browse files Browse the repository at this point in the history
This commit removes unused properties for tests which passed.

This PR substitutes #873 PR.

Co-authored-by: Harshil Gajera <[email protected]>
  • Loading branch information
artemrys and harshilgajera-crest authored Aug 5, 2024
1 parent 8256d2e commit aa35e66
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pytest_splunk_addon/splunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,16 @@ def update_recommended_fields(model, datasets, cim_version):
return update_recommended_fields


@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item):
"""
Show user properties in report only in case of failure
"""
output = yield
if output.get_result().outcome == "passed":
item.user_properties = []


@pytest.fixture(scope="session")
def docker_ip():
"""Determine IP address for TCP connections to Docker containers."""
Expand Down

0 comments on commit aa35e66

Please sign in to comment.