All Projects → nicoulaj → pytest-csv

nicoulaj / pytest-csv

Licence: GPL-3.0 license
CSV reporter for pytest.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pytest-csv

pytest-pycodestyle
pytest plugin to run pycodestyle
Stars: ✭ 15 (-6.25%)
Mutual labels:  pytest, pytest-plugin
pytest-subprocess
Pytest plugin to fake subprocess.
Stars: ✭ 83 (+418.75%)
Mutual labels:  pytest, pytest-plugin
pytest-arraydiff
pytest plugin to facilitate comparison of results to a pre-defined reference
Stars: ✭ 12 (-25%)
Mutual labels:  pytest, pytest-plugin
pytest-docker-tools
Opionated helpers for creating py.test fixtures for Docker integration and smoke testing environments
Stars: ✭ 61 (+281.25%)
Mutual labels:  pytest, pytest-plugin
pytest-involve
A pytest plugin to run tests pertaining to a specific file or changeset
Stars: ✭ 28 (+75%)
Mutual labels:  pytest, pytest-plugin
pytest-localstack
Pytest plugin for local AWS integration tests
Stars: ✭ 66 (+312.5%)
Mutual labels:  pytest, pytest-plugin
pytest-datafiles
pytest plugin to create a tmpdir containing a preconfigured set of files and/or directories.
Stars: ✭ 75 (+368.75%)
Mutual labels:  pytest, pytest-plugin
pytest-snail
Plugin for adding a marker to slow running tests. 🐌
Stars: ✭ 15 (-6.25%)
Mutual labels:  pytest, pytest-plugin
pytest-dependency
Manage dependencies of tests
Stars: ✭ 113 (+606.25%)
Mutual labels:  pytest, pytest-plugin
Pudb
Full-screen console debugger for Python
Stars: ✭ 2,267 (+14068.75%)
Mutual labels:  pytest, pytest-plugin
pytest-notebook
A pytest plugin for regression testing and regenerating Jupyter Notebooks
Stars: ✭ 35 (+118.75%)
Mutual labels:  pytest, pytest-plugin
pytest-neo
Matrix has you...
Stars: ✭ 44 (+175%)
Mutual labels:  pytest, pytest-plugin
pytest-eth
PyTest plugin for testing smart contracts for Ethereum blockchain.
Stars: ✭ 23 (+43.75%)
Mutual labels:  pytest, pytest-plugin
pytest-snapshot
A plugin for snapshot testing with pytest.
Stars: ✭ 68 (+325%)
Mutual labels:  pytest, pytest-plugin
pytest-mock-server
Mock server plugin for pytest
Stars: ✭ 19 (+18.75%)
Mutual labels:  pytest, pytest-plugin
pytest-djangoapp
Nice pytest plugin to help you with Django pluggable application testing.
Stars: ✭ 35 (+118.75%)
Mutual labels:  pytest, pytest-plugin
pytest-test-groups
A Pytest plugin that gives you a way to split your tests into groups of a specific size
Stars: ✭ 37 (+131.25%)
Mutual labels:  pytest, pytest-plugin
pytest-pipeline
Pytest plugin for functional testing of data analysis pipelines
Stars: ✭ 19 (+18.75%)
Mutual labels:  pytest, pytest-plugin
pytest-reportlog
Replacement for the --resultlog option, focused in simplicity and extensibility
Stars: ✭ 36 (+125%)
Mutual labels:  pytest, pytest-plugin
Seleniumbase
A Python framework that inspires developers to become better test automation engineers. 🧠💡
Stars: ✭ 2,520 (+15650%)
Mutual labels:  pytest, pytest-plugin

pytest-csv

last release pypi package pytest supported versions continuous integration

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 add some data directly from a test function, enable properties_as_columns and use:

    def test_01(record_property):
        record_property('my column 1', 42)
        record_property('my column 2', 'foo bar')
    
  • To define new column types, in conftest.py (more examples here):

    def pytest_csv_register_columns(columns):
        columns['my_simple_column'] = lambda item, report: {'my column': report.nodeid}
    

Issues

Please report issues here.

License

This software is released under the GNU General Public License v3.0, see COPYING for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].