Skip to content

Commit

Permalink
Convert to pytest (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
weiwei authored May 7, 2023
1 parent 5648005 commit 81085ec
Show file tree
Hide file tree
Showing 4 changed files with 423 additions and 419 deletions.
20 changes: 8 additions & 12 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# -*- coding: utf-8 -*-

import os
import unittest

import pytest
from junitparser.cli import verify


class Test_Cli(unittest.TestCase):
def test_verify(self):
files_expectedexitcodes = {
"data/jenkins.xml": 1,
"data/no_fails.xml": 0,
"data/normal.xml": 1,
}
for file, expected_exitcode in files_expectedexitcodes.items():
path = os.path.join(os.path.dirname(__file__), file)
self.assertEqual(verify([path]), expected_exitcode)
@pytest.mark.parametrize(
"file, expected_exitcode",
[("data/jenkins.xml", 1), ("data/no_fails.xml", 0), ("data/normal.xml", 1)],
)
def test_verify(file, expected_exitcode):
path = os.path.join(os.path.dirname(__file__), file)
assert verify([path]) == expected_exitcode
Loading

0 comments on commit 81085ec

Please sign in to comment.