Skip to content

Commit

Permalink
test: fix testsuite name detection for older python versions
Browse files Browse the repository at this point in the history
WE use a regex now instead of directly checking for a string
  • Loading branch information
Cube707 committed Feb 10, 2025
1 parent 71382d1 commit 3d59055
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pytest
from junitparser import cli
from junitparser import version
import re

DATA_DIR = Path(__file__).parent / "data"

Expand All @@ -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):
Expand Down

0 comments on commit 3d59055

Please sign in to comment.