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:
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 version="1.0" ?>
<testsuites disabled="0" errors="0" failures="0" tests="1" time="0">
<testsuite name="Test Suite #1" tests="1" assertions="0" disabled="0" errors="0" failures="0" skipped="0" time="0">
<testcase name="Test #1" classname="some.class.name">
<system-out>I am stdout!</system-out>
<system-err>I am stderr!</system-err>
</testcase>
</testsuite>
</testsuites>
Running the tests
$ pytest tests
License
This project is licensed under the GNU General Public License v3.0.
Release files for junit-reporter 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| junit-reporter-0.1.0.tar.gz | 19.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| junit_reporter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.7 kB
Release files / junit-reporter-0.1.0.tar.gz
| Download URL | junit-reporter-0.1.0.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c560f149c2f75ed5d1899fe1d90960ff507db03923e5cd053f24c07a82e79c7
|
|
BLAKE2b-256 checksum How to use checksums |
45e577f0365502461e4abd983ecaa19c46788e673f3c08238426a9dfcfadb7d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.6
|
Release files / junit_reporter-0.1.0-py3-none-any.whl
| Download URL | junit_reporter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f367e5e0a0cefd16f8ffaa495edfcc2f2bae4c5ef0723100648969d5827b6832
|
|
BLAKE2b-256 checksum How to use checksums |
99a6782f8e7f1e87caddb043b00e6c9f27e9813337e35b9554f001ac2572763d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.6
|