diff --git a/tests/test_html_merge.py b/tests/test_html_merge.py
index d97ab83..acebfef 100644
--- a/tests/test_html_merge.py
+++ b/tests/test_html_merge.py
@@ -16,27 +16,32 @@ def session_tmp_path(tmp_path_factory: pytest.TempPathFactory) -> Path:
return tmp_path_factory.mktemp("html_test")
-def test_merge_html(session_tmp_path: Path):
+@pytest.fixture(scope="session")
+def html_file(session_tmp_path: Path) -> Path:
"""combines all generated pytest html reports into one"""
in_dir_path = Path(__file__).parent / "assets" / "html_merge"
in_dir_path = in_dir_path.resolve()
ic(in_dir_path)
- out_file_path = session_tmp_path / "test.html"
- out_assets_dir = session_tmp_path / "assets"
+ html_file = session_tmp_path / "test.html"
- merge_html_reports(in_dir_path.as_posix(), out_file_path.as_posix(), "combined.html")
+ merge_html_reports(in_dir_path.as_posix(), html_file.as_posix(), "combined.html")
+ return html_file
- assert out_file_path.is_file()
- assert out_assets_dir.is_dir()
- assert next(out_assets_dir.glob("*"))
+
+def test_merge_html(html_file: Path):
+ assert html_file.is_file()
+ assert html_file.parent.is_dir()
+ assert next(html_file.parent.glob("*"))
@pytest.mark.slow
-def test_check_result_with_playwright(session_tmp_path, context: BrowserContext):
- html_file = session_tmp_path / "test.html"
+def test_check_result_with_playwright(html_file: Path, context: BrowserContext):
+ assert html_file.is_file()
+
file_url = BaseUrl(netloc=html_file.as_posix(), scheme="file").get()
+
page = context.new_page()
page.goto(file_url)