From 3d590554b22ed567769a3a6d9384cbac00c491f9 Mon Sep 17 00:00:00 2001 From: Jan Wille Date: Mon, 10 Feb 2025 15:54:35 +0100 Subject: [PATCH] test: fix testsuite name detection for older python versions WE use a regex now instead of directly checking for a string --- tests/test_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index e39b4cc..eccf726 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -2,6 +2,7 @@ import pytest from junitparser import cli from junitparser import version +import re DATA_DIR = Path(__file__).parent / "data" @@ -21,7 +22,7 @@ def test_merge(tmp_path: Path): cli.merge(files, str(outfile)) xml = outfile.read_text() for s in suites: - assert f'testsuite name="{s}"' in xml + assert re.match(f'testsuite[^>]*name="{s}"', xml) def test_merge_output_to_terminal(capsys: pytest.CaptureFixture):