Skip to content

Commit

Permalink
Add pytest reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
awtkns committed Nov 28, 2023
1 parent e8959bd commit 47c1f88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions bananalyzer/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ def pytest_terminal_summary(
terminalreporter.write_line("Summary:")
terminalreporter.write_line(tabulate(table_data.items(), tablefmt="psql"))

# noinspection PyBroadException
@pytest.fixture(autouse=True)
def add_user_properties(self, record_property, request) -> None: # type: ignore
for key, value in {
"field": request.node.callspec.params.get("key", ""),
"class": request.cls.__name__,
for key, accessor in {
"field": lambda *_: request.node.callspec.params.get("key"),
"class": lambda *_: request.cls.__name__,
}.items():
record_property(key, value)
try:
record_property(key, accessor())
except Exception:
pass

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "bananalyzer"
version = "0.6.0"
version = "0.6.1"
description = "Open source AI Agent evaluation framework for web tasks 🐒🍌"
authors = ["asim-shrestha <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 47c1f88

Please sign in to comment.