Skip to content

Commit

Permalink
test: fix cli test which fails only under lxml
Browse files Browse the repository at this point in the history
under `lxml` the `encoding` property "UTF-8" is written in capslock, without `lxml` its lowercase.
So we ignore that property and only test for the "<?xml version='1.0'" part
  • Loading branch information
Cube707 committed Feb 10, 2025
1 parent b642f33 commit 416d59a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

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


@pytest.mark.parametrize(
"file, expected_exitcode",
[("jenkins.xml", 1), ("no_fails.xml", 0), ("normal.xml", 1)],
Expand All @@ -22,14 +21,14 @@ 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 f'name="{s}"' in xml


def test_merge_output_to_terminal(capsys: pytest.CaptureFixture):
ret = cli.main(["merge", str(DATA_DIR / "normal.xml"), "-"])
assert ret == 0
captured = capsys.readouterr()
assert captured.out.startswith("<?xml version='1.0' encoding='utf-8'?>")
assert captured.out.startswith("<?xml version='1.0'")


def test_verify_with_glob():
Expand Down

0 comments on commit 416d59a

Please sign in to comment.