# pytest-testdox
[![PyPI](https://img.shields.io/pypi/v/pytest-testdox.svg?color=brightgreen)](https://pypi.org/project/pytest-testdox/)
[![Continuous Integration Status](https://github.com/renanivo/pytest-testdox/workflows/Continuous%20Integration/badge.svg)](https://github.com/renanivo/pytest-testdox/actions?query=workflow%3A%22Continuous+Integration%22)
[![codecov](https://codecov.io/gh/renanivo/pytest-testdox/branch/master/graph/badge.svg)](https://codecov.io/gh/renanivo/pytest-testdox)
A [TestDox format](https://en.wikipedia.org/wiki/TestDox) reporter for pytest.
![](https://i.imgur.com/rJRL4x9.png)
## Install
```
pip install pytest-testdox
```
## Usage
Add the parameter `--testdox` when running `pytest`. For example:
```sh
pytest --testdox your-tests/
```
Tip: If you don't want to type `--testdox` every time you run `pytest`, add it
to [`addopts`](https://docs.pytest.org/en/latest/customize.html#confval-addopts)
in your [ini file](https://docs.pytest.org/en/latest/customize.html#initialization-determining-rootdir-and-inifile).
For example:
```ini
# content of pytest.ini or tox.ini
[pytest]
addopts = --testdox
# or if you use setup.cfg
[tool:pytest]
addopts = --testdox
```
When using `--testdox`, the plugin will disable itself when not running on a
terminal. If you want the testdox report no matter what, use the parameter
`--force-testdox` instead.
## Markers
### @pytest.mark.describe
Override the class name in the testdox report. For example:
```python
# 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. For example:
```python
# 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`). For example:
```ini
# content of pytest.ini
# (or tox.ini or setup.cfg)
[pytest]
testdox_format = plaintext
```
```console
$ 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
```
Raw data
{
"_id": null,
"home_page": "https://github.com/renanivo/pytest-testdox",
"name": "pytest-testdox",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "pytest testdox test report bdd",
"author": "Renan Ivo",
"author_email": "renanivom@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/64/32/d833d70c7b30994c593d721001ab218f02baee4f6d5be322e9ba3f7f77c0/pytest-testdox-3.1.0.tar.gz",
"platform": null,
"description": "# pytest-testdox\n\n[![PyPI](https://img.shields.io/pypi/v/pytest-testdox.svg?color=brightgreen)](https://pypi.org/project/pytest-testdox/)\n[![Continuous Integration Status](https://github.com/renanivo/pytest-testdox/workflows/Continuous%20Integration/badge.svg)](https://github.com/renanivo/pytest-testdox/actions?query=workflow%3A%22Continuous+Integration%22)\n[![codecov](https://codecov.io/gh/renanivo/pytest-testdox/branch/master/graph/badge.svg)](https://codecov.io/gh/renanivo/pytest-testdox)\n\nA [TestDox format](https://en.wikipedia.org/wiki/TestDox) reporter for pytest.\n\n![](https://i.imgur.com/rJRL4x9.png)\n\n## Install\n\n```\npip install pytest-testdox\n```\n\n## Usage\n\nAdd the parameter `--testdox` when running `pytest`. For example:\n\n```sh\npytest --testdox your-tests/\n```\n\nTip: If you don't want to type `--testdox` every time you run `pytest`, add it\nto [`addopts`](https://docs.pytest.org/en/latest/customize.html#confval-addopts)\nin your [ini file](https://docs.pytest.org/en/latest/customize.html#initialization-determining-rootdir-and-inifile).\nFor example:\n\n```ini\n# content of pytest.ini or tox.ini\n[pytest]\naddopts = --testdox\n\n# or if you use setup.cfg\n[tool:pytest]\naddopts = --testdox\n```\n\nWhen using `--testdox`, the plugin will disable itself when not running on a\nterminal. If you want the testdox report no matter what, use the parameter\n`--force-testdox` instead.\n\n\n## Markers\n\n### @pytest.mark.describe\n\nOverride the class name in the testdox report. For example:\n\n```python\n# test_demo.py\n@pytest.mark.describe('create_file')\nclass TestCreateFile():\n\n def test_creates_a_file_in_the_so(self):\n pass\n```\n\nWill produce the output:\n\n```\ntest_demo.py\n\ncreate_file\n [x] creates a file in the so\n```\n\n### @pytest.mark.it\n\nOverride the test title in the testdox report. For example:\n\n```python\n# test_demo.py\nclass TestCreateFile():\n\n @pytest.mark.it('Creates a local file in the SO')\n def test_creates_a_file_in_the_so(self):\n pass\n```\n\nWill produce the output:\n\n\n```\ntest_demo.py\n\nCreate File\n [x] Creates a local file in the SO\n```\n\n## Configuration file options\n\n### testdox_format\n\nSpecifies TestDox report format, `plaintext` or `utf8` (default:\n`utf8`). For example:\n\n```ini\n# content of pytest.ini\n# (or tox.ini or setup.cfg)\n[pytest]\ntestdox_format = plaintext\n```\n\n```console\n$ pytest test_demo.py\n============================= test session starts ==============================\nplatform darwin -- Python 3.5.0, pytest-3.0.7, py-1.4.33, pluggy-0.4.0\nrootdir: /private/tmp/demo, inifile: pytest.ini\nplugins: testdox-dev\ncollected 2 items\n\ntest_demo.py\nPytest Testdox\n [x] prints a BDD style output to your tests\n [x] lets you focus on the behavior\n```\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A testdox format reporter for pytest",
"version": "3.1.0",
"project_urls": {
"Homepage": "https://github.com/renanivo/pytest-testdox"
},
"split_keywords": [
"pytest",
"testdox",
"test",
"report",
"bdd"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "948c515ff4ab03b744b00f1283455ff189537082a16f62aa5ace6171f4cb5aea",
"md5": "fa2b21383fb7a65603089dda19754abd",
"sha256": "f3a8f0789d668ccfb60f15aab81fb927b75066cfd19209176166bd7cecae73e6"
},
"downloads": -1,
"filename": "pytest_testdox-3.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "fa2b21383fb7a65603089dda19754abd",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 9041,
"upload_time": "2023-07-22T03:42:46",
"upload_time_iso_8601": "2023-07-22T03:42:46.069722Z",
"url": "https://files.pythonhosted.org/packages/94/8c/515ff4ab03b744b00f1283455ff189537082a16f62aa5ace6171f4cb5aea/pytest_testdox-3.1.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6432d833d70c7b30994c593d721001ab218f02baee4f6d5be322e9ba3f7f77c0",
"md5": "c36e95e5bc5ab7cad9caccef673618eb",
"sha256": "f48c49c517f0fb926560b383062db4961112078ec6ca555f91692c661bb5c765"
},
"downloads": -1,
"filename": "pytest-testdox-3.1.0.tar.gz",
"has_sig": false,
"md5_digest": "c36e95e5bc5ab7cad9caccef673618eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 8917,
"upload_time": "2023-07-22T03:42:47",
"upload_time_iso_8601": "2023-07-22T03:42:47.476953Z",
"url": "https://files.pythonhosted.org/packages/64/32/d833d70c7b30994c593d721001ab218f02baee4f6d5be322e9ba3f7f77c0/pytest-testdox-3.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-22 03:42:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "renanivo",
"github_project": "pytest-testdox",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pytest-testdox"
}