CSV output for pytest.
Project description
CSV output for pytest.
Installation
Install using pip:
pip install pytest-csv
Usage
To enable the CSV report:
py.test --csv tests.csv
To customize the CSV delimiter/quoting characters:
py.test --csv tests.csv --csv-delimiter ';' --csv-quote-char '"'
To customize the columns:
py.test --csv tests.csv --csv-columns host,function,status,duration,parameters_as_columns
This is the reference of all available columns:
Column
Description
id
pytest test identifier
module
test module name
class
test class
function
test function name
name
test name, with arguments
file
test module file
doc
test function docstring
status
test status (passed, failed, error, skipped, xpassed or xfailed)
success
test status, as a boolean
duration
test duration, in seconds
duration_formatted
test duration, human readable
message
error message, if any
markers
test markers, as a comma-separated list
markers_with_args
test markers with their arguments, as a comma-separated list
markers_as_columns
test markers, each as a separate column
markers_args_as_columns
test markers with their arguments, each as a separate column
parameters
test parameters, as a comma-separated list
parameters_as_columns
test parameters, each as a separate column
properties
properties recorded using record_property, as a comma-separated list
properties_as_columns
properties recorded using record_property, each as a separate column
user
current user name
host
current host (from platform module)
system
current system name (from platform module)
system_release
current system release info (from platform module)
system_version
current system version info (from platform module)
python_implementation
current python implementation (from platform module)
python_version
current python version (from platform module)
working_directory
current working directory
To define a new column type, in conftest.py:
from pytest_csv import Column class MyColumn(Column): def run(self, report): yield 'my column', 'my value' def pytest_csv_register_columns(columns): columns['my_column'] = MyColumn()
Issues
Please report issues here.
License
This software is released under the GNU General Public License v3.0, see COPYING for details.
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
Built Distribution
Hashes for pytest_csv-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99be04f90e378d21a82e9e9128f2a247972fdaf8d3ab57691f92f6ca1e9d8df4 |
|
MD5 | 2f50896609d7a4d270db8666c08461fe |
|
BLAKE2b-256 | 2558c30c5480fe77ae25e62a22f7dd719c2033b3f960592540a8bd396a37b306 |