An open API service indexing awesome lists of open source software.

https://github.com/robert-96/junit-reporter

A Python3 package that generates test results in the standard JUnit XML format for use with Jenkins and other build integration servers.
https://github.com/robert-96/junit-reporter

junit python test testing testing-tools xml

Last synced: about 1 year ago
JSON representation

A Python3 package that generates test results in the standard JUnit XML format for use with Jenkins and other build integration servers.

Awesome Lists containing this project

README

          

# junit-reporter

A Python3 package that generates test results in the standard JUnit XML format for use with Jenkins and other build integration servers.

## Installation

Use the following command to install ``junit-reporter``:

```
$ pip install junit-reporter
```

## Quickstart

Create a test report:

```python
from junit_reporter import TestCase, TestSuite, JUnitReporter

test_case = TestCase('Test #1', classname='some.class.name', stdout='I am stdout!', stderr='I am stderr!')
test_suite = TestSuite('Test Suite #1', [test_case])

xml = JUnitReporter.report_to_string([test_suite])
```

It produces the following output:

```xml



I am stdout!
I am stderr!

```

## Running the tests

```
$ pytest tests
```

## License

This project is licensed under the [GNU General Public License v3.0](LICENSE).