Skip to main content

PyPI package Documentation Test results Test coverage Code analysis License Analytics

unitth

This package provides a Python method and command line interface for generating HTML reports of unit test histories. The package is a Python interface for the UnitTH.

Installation

  • Latest release from PyPI pip install unitth

  • Latest revision from GitHub pip install git+https://github.com/KarrLab/unitth.git#egg=unitth

Usage

Command line

usage: unitth (sub-commands ...) [options ...] {arguments ...}

Generate HTML unit test history report

positional arguments:
  xml_report_dir        Parent directory of XML reports of individual builds
                        to generate a history report of

optional arguments:
  -h, --help            show this help message and exit
  --debug               toggle debug output
  --quiet               suppress all output
  --xml-report-filter [XML_REPORT_FILTER]
                        Starts-with filter for individual reports with `xml-
                        report-dir` that should be included in the history
                        report. Set `xml-report-filter` to to include all
                        files/subdirectories in the history report.
  --html-report-path HTML_REPORT_PATH
                        Directory of HTML reports of individual
                        builds(relative to XML directories of individual
                        builds)
  --generate-exec-time-graphs GENERATE_EXEC_TIME_GRAPHS
                        Whether execution time graphs shall be generated
  --html-report-dir HTML_REPORT_DIR
                        directory to store generated HTML history report
  --initial_java_heap_size INITIAL_JAVA_HEAP_SIZE
                        Initial Java heap size
  --maximum_java_heap_size MAXIMUM_JAVA_HEAP_SIZE
                        Maximum Java heap size

Example usage

Python

from nose2unitth.core import Converter as nose2unitth
from junit2htmlreport.parser import Junit as JunitParser
from unitth.core import UnitTH
import os
import subprocess

os.mkdir('reports')
os.mkdir('reports/nose')
os.mkdir('reports/unitth')
os.mkdir('reports/html')

subprocess.check_call(['nosetests', 'tests/test_unitth.py:TestDummy.test_dummy_test',
                       '--with-xunit', '--xunit-file', 'reports/nose/1.xml'])
subprocess.check_call(['nosetests', 'tests/test_unitth.py:TestDummy.test_dummy_test',
                       '--with-xunit', '--xunit-file', 'reports/nose/2.xml'])

nose2unitth.run('reports/nose/1.xml', 'reports/unitth/1')
nose2unitth.run('reports/nose/2.xml', 'reports/unitth/2')

with open('reports/unitth/1/index.html', 'wb') as html_file:
    print >> html_file, JunitParser('reports/nose/1.xml').html()
with open('reports/unitth/2/index.html', 'wb') as html_file:
    print >> html_file, JunitParser('reports/nose/2.xml').html()

UnitTH.run('reports/unitth/*', xml_report_filter='', html_report_dir='reports/html')

Command line

mkdir reports
mkdir reports/nose
mkdir reports/unitth
mkdir reports/html

nosetests tests/test_unitth.py:TestDummy.test_dummy_test --with-xunit --xunit-file reports/nose/1.xml
nosetests tests/test_unitth.py:TestDummy.test_dummy_test --with-xunit --xunit-file reports/nose/2.xml

nose2unitth reports/nose/1.xml reports/unitth/1
nose2unitth reports/nose/2.xml reports/unitth/2

junit2html reports/nose/1.xml reports/unitth/1/index.html
junit2html reports/nose/2.xml reports/unitth/2/index.html

unitth --xml_report_filter --html_report_dir reports/html "reports/unitth/*"

Documentation

Please see the API documentation.

License

The build utilities are released under the MIT license.

Development team

This package was developed by Jonathan Karr at the Icahn School of Medicine at Mount Sinai in New York, USA.

Questions and comments

Please contact the Jonathan Karr with any questions or comments.

Metadata

Release files for unitth 0.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unitth 0.0.14
File Size Uploaded
unitth-0.0.14.tar.gz 110.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unitth 0.0.14
File Interpreter ABI Platform
unitth-0.0.14-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 216.8 kB

Release files / unitth-0.0.14.tar.gz

Download URL unitth-0.0.14.tar.gz
Size 110.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1a58f6a33c0ed0f97956b3d2aff37fa0f2ceb7a4ab60d705a45bf7bd5c525e5f
BLAKE2b-256 checksum
How to use checksums
247452a993bd455f5e157234b5321b225f10a538918ad9ef2c99a933b5938ebd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.23.2 CPython/3.6.3

Release files / unitth-0.0.14-py2.py3-none-any.whl

Download URL unitth-0.0.14-py2.py3-none-any.whl
Size 106.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f38266448234078171057b91aa25e01968f47a4463349bda2b104c811405a2d4
BLAKE2b-256 checksum
How to use checksums
41f7fa90ca5fb4710d5f476e15ae688feedc771de8012cefa6a1eab5b11a772c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.23.2 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page