Skip to content

Commit

Permalink
perf: avoid log output during benchmarking
Browse files Browse the repository at this point in the history
johnnymillergh committed May 14, 2023
1 parent 985ae47 commit 4ed750c
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions tests/template/test_html_template.py
Original file line number Diff line number Diff line change
@@ -8,6 +8,19 @@


def test_render_template_when_the_template_exists_then_no_raised_exception() -> None:
try:
rendered = render_template_with_parameters()
except Exception as ex:
assert False, f"Could not render template. {ex}"
assert rendered is not None
assert len(rendered) > 0
assert "Basketball" in rendered
assert "Hello reader, here is a table" in rendered
assert "cid:a_picture_id" in rendered
logger.info(f"Rendered template: \n{rendered}")


def render_template_with_parameters() -> str:
render_dict: dict[str, Any] = {}
dict_table_data: list[dict[str, Any]] = [
{"Name": "Basketball", "Type": "Sports", "Value": 5},
@@ -24,16 +37,7 @@ def test_render_template_when_the_template_exists_then_no_raised_exception() ->
"dict_table_data": dict_table_data,
}
)
try:
rendered = render_template("template_example.html", render_dict)
except Exception as ex:
assert False, f"Could not render template. {ex}"
assert rendered is not None
assert len(rendered) > 0
assert "Basketball" in rendered
assert "Hello reader, here is a table" in rendered
assert "cid:a_picture_id" in rendered
logger.info(f"Rendered template: \n{rendered}")
return render_template("template_example.html", render_dict)


def test_render_template_benchmark(benchmark: BenchmarkFixture) -> None:

0 comments on commit 4ed750c

Please sign in to comment.