Skip to content

Commit 965162a

Browse files
authored
120 mismatch in test name vs screenshot filename during copy missing screenshots in report (#121) (#122)
* Fix issue 120 * sanitize before writing to json file * Update pyproject.toml
1 parent 23c84ee commit 965162a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pytest-html-plus"
3-
version = "0.3.5"
3+
version = "0.3.6"
44
description = "Auto-generated HTML reports with filters, screenshots, logs, flaky detection & more — all without writing a single line of config."
55
readme = "README.md"
66
authors = ["Emjey", "Karan"]

pytest_html_plus/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ def pytest_runtest_makereport(item, call):
6565

6666
reporter = config._json_reporter
6767
worker_id = os.getenv("PYTEST_XDIST_WORKER") or "main"
68+
test_name = "".join(c if c.isalnum() else "_" for c in item.name)
6869
reporter.log_result(
69-
test_name=item.name,
70+
test_name=test_name,
7071
nodeid=item.nodeid,
7172
status=report.outcome,
7273
duration=report.duration,

0 commit comments

Comments
 (0)