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.
- Host: GitHub
- URL: https://github.com/robert-96/junit-reporter
- Owner: Robert-96
- License: gpl-3.0
- Created: 2021-04-02T19:46:17.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-02T01:37:51.000Z (about 2 years ago)
- Last Synced: 2025-03-13T01:48:07.265Z (over 1 year ago)
- Topics: junit, python, test, testing, testing-tools, xml
- Language: Python
- Homepage: https://junit-reporter.readthedocs.io/
- Size: 678 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- License: LICENSE
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).