Skip to main content

A testdox format reporter for pytest

Project description

https://travis-ci.org/renanivo/pytest-testdox.svg?branch=master https://codecov.io/gh/renanivo/pytest-testdox/branch/master/graph/badge.svg

A TestDox format reporter for pytest

http://i.imgur.com/rJRL4x9.png

Install

pip install pytest-testdox

Usage

Add the parameter –testdox when running pytest. Ex:

pytest --testdox your-tests/

Tip: If you don’t want to type --testdox every time you run pytest, add it to addopts in your ini file. Ex:

# content of pytest.ini
# (or tox.ini or setup.cfg)
[pytest]
addopts = --testdox

Markers

@pytest.mark.describe

Override the class name in the testdox report. Example

# test_demo.py
@pytest.mark.describe('create_file')
class TestCreateFile():

    def test_creates_a_file_in_the_so(self):
        pass

Will produce the output:

test_demo.py

create_file
 [x] creates a file in the so

@pytest.mark.it

Override the test title in the testdox report. Example:

# test_demo.py
class TestCreateFile():

    @pytest.mark.it('Creates a local file in the SO')
    def test_creates_a_file_in_the_so(self):
        pass

Will produce the output:

test_demo.py

Create File
 [x] Creates a local file in the SO

Configuration file options

testdox_format

Specifies TestDox report format, plaintext or utf8 (default: utf8). Ex:

# content of pytest.ini
# (or tox.ini or setup.cfg)
[pytest]
testdox_format = plaintext
$ pytest test_demo.py
============================= test session starts ==============================
platform darwin -- Python 3.5.0, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
rootdir: /private/tmp/demo, inifile: pytest.ini
plugins: testdox-dev
collected 2 items

test_demo.py
Pytest Testdox
 [x] prints a BDD style output to your tests
 [x] lets you focus on the behavior

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-testdox-1.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_testdox-1.1.0-py2.py3-none-any.whl (8.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-testdox-1.1.0.tar.gz.

File metadata

  • Download URL: pytest-testdox-1.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for pytest-testdox-1.1.0.tar.gz
Algorithm Hash digest
SHA256 01acd85ba3c5a63ee834ad0e76231c0b13dfc4a4aa8247fae8c2a9e2a4ebf725
MD5 bfcb2df75a4b160af1d0bb9135387e7a
BLAKE2b-256 7316f5b4d5add2e62e2704a1dc637b7ede7d83a1449eb028eb8bd0f5aedb6322

See more details on using hashes here.

File details

Details for the file pytest_testdox-1.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_testdox-1.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for pytest_testdox-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 db6cc05b5467a9a26656d19f25c5ff79f72c078fde5e3aed98338e688bd7478c
MD5 994a3b54d3d09da1752d2056b6627736
BLAKE2b-256 ab6bf02b79b1c1c48c6013c58ea3be3f84fed5027ed3c4492df4ebbc49498fbf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page