Introduction
This package provides a zope.testrunner feature that stores the test results in a JUnit-compatible XML file. This file can be consumed by Jenkins and other tools to generate test reports.
This is achieved by implementing a custom output formatter that collects and then writes out the XML file. The formatter then delegates further test result tracking to the oriignal output formatter.
The core code of this package is based on the excellent work by Martin Aspelli and the Plone Foundation. Thus the code is released under ZPL 2.1, the original license of collective.xmltestreport.
Usage
In order to install your own features, you have to customize the main Runner class a bit. Here is what we do at Shoobx:
from shoobx.junitxml import feature
import zope.testrunner.runner
feature.JUnitXMLSupport.install_options()
class Runner(zope.testrunner.runner.Runner):
def configure(self):
super(Runner, self).configure()
self.features.append(feature.JUnitXMLSupport(self))
zope.testrunner.runner.Runner = Runner
Call the test runner with the argument –xml=junit.xml to specify the name of the generated JUnit file.
Code repository
Changelog
0.3.0 (2024-12-18)
Rename command line option –xml` to --junitxml since zope.testrunner 6.3.0 added the same option and there’s a conlict
0.2.2 (2021-01-13)
Fixed documentation.
0.2.1 (2020-12-03)
Support for latest zope.testrunner and other latest dependencies
Added missing stderr and stdout params to test_failure and test_error methods of XMLOutputFormattingWrapper (prevented xml report file generation in zope.testrunner >= 5.1)
dropped support for python 2, updated support for 3.X
0.2.0 (2018-10-10)
Add support for Python 3.7
Add support for the latest zope.testrunner, which switches from optparse to argparse.
0.1.4 (2018-03-30)
Record doctest cases in modules where test cases are defined, instead of putting them all in ‘doctest’ module.
0.1.3 (2018-02-09)
Bugfix: When test failure has binary data, record a Base64 representation of the failure
0.1.2 (2018-02-07)
Python 3 bugfix
0.1.1 (2017-10-03)
Added some basic tests.
Official Python 3.6 support.
0.1.0 (2017-10-03)
Initial release
Metadata
Release files for shoobx.junitxml 0.3.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 | |
|---|---|---|---|
| shoobx.junitxml-0.3.0.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| shoobx.junitxml-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.9 kB
Release files / shoobx.junitxml-0.3.0.tar.gz
| Download URL | shoobx.junitxml-0.3.0.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0309fdb87d931d8f226066466a1361ba14e0093573d170585b4014f6e969e8f6
|
|
BLAKE2b-256 checksum How to use checksums |
8ec95c6e7829535c6cc69346969383840328c4847c9a2dbcdf33737d95524aa7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / shoobx.junitxml-0.3.0-py3-none-any.whl
| Download URL | shoobx.junitxml-0.3.0-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a622f7ed3b90ae367ed6ace6bb245d8e3a2eb94ef5271e5d15fafe30ab0b910
|
|
BLAKE2b-256 checksum How to use checksums |
06680f163b9e7cb54f9c870d71e43c1bfb6ed3005003aa7858d58de25defe17a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|