pytest-spec


Namepytest-spec JSON
Version 3.2.0 PyPI version JSON
download
home_pagehttps://github.com/pchomik/pytest-spec
SummaryLibrary pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.
upload_time2021-05-04 09:03:21
maintainer
docs_urlNone
authorPawel Chomicki
requires_python
licenseGPL-2.0-or-later
keywords pytest test unittest spec
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p>
    <h1 align="center">pytest-spec</h1>
    <p align="center">
        <img src="https://badgen.net/badge/python/2.7/green">
        <img src="https://badgen.net/badge/python/3.5/green">
        <img src="https://badgen.net/badge/python/3.6/green">
        <img src="https://badgen.net/badge/python/3.7/green">
        <img src="https://badgen.net/badge/python/3.8/green">
        <img src="https://badgen.net/badge/python/3.9/green">
    </p>
    <p align="center">
        <img src="https://badgen.net/badge/os/linux/blue">
        <img src="https://badgen.net/badge/os/windows/blue">
        <img src="https://badgen.net/badge/os/macos/blue">
    </p>
    <p align="center">
        <img src="https://badgen.net/badge/pytest/3.9.3/purple">
        <img src="https://badgen.net/badge/pytest/4.6.11/purple">
        <img src="https://badgen.net/badge/pytest/5.4.3/purple">
        <img src="https://badgen.net/badge/pytest/6.1.2/purple">
    </p>
    <p align="center">
        Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.
    </p>
</p>


## Available features

* Format output to look like specification.
* Group tests by classes and files
* Failed, passed and skipped are marked and colored.
* Remove test\_ and underscores for every test.
* It is possible to use docstring summary instead of test name.
* Supports function based, class based test.
* Supports describe like tests.


## Output example

![Example](https://github.com/pchomik/pytest-spec/raw/master/docs/output.gif)


## Configuration

### spec_header_format

You can configure the format of the test headers by specifying a [format string](https://docs.python.org/2/library/string.html#format-string-syntax) in your [ini-file](http://doc.pytest.org/en/latest/customize.html#inifiles):

```ini
    [tool:pytest]
    spec_header_format = {module_path}:
```

In addition to the ``{path}`` and ``{class_name}`` replacement fields, there is also ``{test_case}`` that holds a more human readable name.

### spec_test_format

You can configure the format of the test results by specifying a [format string](https://docs.python.org/2/library/string.html#format-string-syntax) in your [ini-file](http://doc.pytest.org/en/latest/customize.html#inifiles):

3 variables are available:
* result - place for indicator
* name - name of test
* docstring_summary - first line from test docstring if available

```ini
    [tool:pytest]
    spec_test_format = {result} {name}
```

or

```ini
    [tool:pytest]
    spec_test_format = {result} {docstring_summary}
```

In second example where docstring is not available the name will be added to spec output.

### spec_success_indicator

You can configure the indicator displayed when test passed.

```ini
    [tool:pytest]
    spec_success_indicator = ✓
```

### spec_failure_indicator

You can configure the indicator displated when test failed.

```ini
    [tool:pytest]
    spec_failure_indicator = ✗
```

### spec_skipped_indicator

You can configure the indicator displated when test is skipped.

```ini
    [tool:pytest]
    spec_skipped_indicator = ?
```

### spec_ignore

Comma-separated settings to ignore/hide some tests or output from from plugins like FLAKE8 or ISORT.
Any test which contain provided string will be ignored in output spec.

```ini
    [tool:pytest]
    spec_ignore = FLAKE8
```

### spec_indent

```ini
    [tool:pytest]
    spec_indent = "   "
```

## Continuous Integration

[![Tests](https://github.com/pchomik/pytest-spec/workflows/test/badge.svg)](https://github.com/pchomik/pytest-spec/actions)


## Download

All versions of library are available on official [pypi server](https://pypi.org/project/pytest-spec/#history).

## Install

```sh
    pip install pytest-spec
```

## Contribution

Please feel free to present your idea by code example (pull request) or reported issues.

## Contributors

* [@0x64746b](https://github.com/0x64746b)
* [@lucasmarshall](https://github.com/lucasmarshall)
* [@amcgregor](https://github.com/amcgregor)
* [@jhermann](https://github.com/jhermann)
* [@frenzymadness](https://github.com/frenzymadness)
* [@chrischambers](https://github.com/chrischambers)
* [@maxalbert](https://github.com/maxalbert)
* [@jayvdb](https://github.com/jayvdb)

## License

pytest-spec - pytest plugin to display test execution output like a SPECIFICATION.

Copyright (C) 2014-2021 Pawel Chomicki

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pchomik/pytest-spec",
    "name": "pytest-spec",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pytest,test,unittest,spec",
    "author": "Pawel Chomicki",
    "author_email": "pawel.chomicki@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ea/9f/61c27fbad6cddc593405b072a726ff67c43c4802a54ddb22ffbcb1c25ae5/pytest-spec-3.2.0.tar.gz",
    "platform": "",
    "description": "<p>\n    <h1 align=\"center\">pytest-spec</h1>\n    <p align=\"center\">\n        <img src=\"https://badgen.net/badge/python/2.7/green\">\n        <img src=\"https://badgen.net/badge/python/3.5/green\">\n        <img src=\"https://badgen.net/badge/python/3.6/green\">\n        <img src=\"https://badgen.net/badge/python/3.7/green\">\n        <img src=\"https://badgen.net/badge/python/3.8/green\">\n        <img src=\"https://badgen.net/badge/python/3.9/green\">\n    </p>\n    <p align=\"center\">\n        <img src=\"https://badgen.net/badge/os/linux/blue\">\n        <img src=\"https://badgen.net/badge/os/windows/blue\">\n        <img src=\"https://badgen.net/badge/os/macos/blue\">\n    </p>\n    <p align=\"center\">\n        <img src=\"https://badgen.net/badge/pytest/3.9.3/purple\">\n        <img src=\"https://badgen.net/badge/pytest/4.6.11/purple\">\n        <img src=\"https://badgen.net/badge/pytest/5.4.3/purple\">\n        <img src=\"https://badgen.net/badge/pytest/6.1.2/purple\">\n    </p>\n    <p align=\"center\">\n        Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.\n    </p>\n</p>\n\n\n## Available features\n\n* Format output to look like specification.\n* Group tests by classes and files\n* Failed, passed and skipped are marked and colored.\n* Remove test\\_ and underscores for every test.\n* It is possible to use docstring summary instead of test name.\n* Supports function based, class based test.\n* Supports describe like tests.\n\n\n## Output example\n\n![Example](https://github.com/pchomik/pytest-spec/raw/master/docs/output.gif)\n\n\n## Configuration\n\n### spec_header_format\n\nYou can configure the format of the test headers by specifying a [format string](https://docs.python.org/2/library/string.html#format-string-syntax) in your [ini-file](http://doc.pytest.org/en/latest/customize.html#inifiles):\n\n```ini\n    [tool:pytest]\n    spec_header_format = {module_path}:\n```\n\nIn addition to the ``{path}`` and ``{class_name}`` replacement fields, there is also ``{test_case}`` that holds a more human readable name.\n\n### spec_test_format\n\nYou can configure the format of the test results by specifying a [format string](https://docs.python.org/2/library/string.html#format-string-syntax) in your [ini-file](http://doc.pytest.org/en/latest/customize.html#inifiles):\n\n3 variables are available:\n* result - place for indicator\n* name - name of test\n* docstring_summary - first line from test docstring if available\n\n```ini\n    [tool:pytest]\n    spec_test_format = {result} {name}\n```\n\nor\n\n```ini\n    [tool:pytest]\n    spec_test_format = {result} {docstring_summary}\n```\n\nIn second example where docstring is not available the name will be added to spec output.\n\n### spec_success_indicator\n\nYou can configure the indicator displayed when test passed.\n\n```ini\n    [tool:pytest]\n    spec_success_indicator = \u2713\n```\n\n### spec_failure_indicator\n\nYou can configure the indicator displated when test failed.\n\n```ini\n    [tool:pytest]\n    spec_failure_indicator = \u2717\n```\n\n### spec_skipped_indicator\n\nYou can configure the indicator displated when test is skipped.\n\n```ini\n    [tool:pytest]\n    spec_skipped_indicator = ?\n```\n\n### spec_ignore\n\nComma-separated settings to ignore/hide some tests or output from from plugins like FLAKE8 or ISORT.\nAny test which contain provided string will be ignored in output spec.\n\n```ini\n    [tool:pytest]\n    spec_ignore = FLAKE8\n```\n\n### spec_indent\n\n```ini\n    [tool:pytest]\n    spec_indent = \"   \"\n```\n\n## Continuous Integration\n\n[![Tests](https://github.com/pchomik/pytest-spec/workflows/test/badge.svg)](https://github.com/pchomik/pytest-spec/actions)\n\n\n## Download\n\nAll versions of library are available on official [pypi server](https://pypi.org/project/pytest-spec/#history).\n\n## Install\n\n```sh\n    pip install pytest-spec\n```\n\n## Contribution\n\nPlease feel free to present your idea by code example (pull request) or reported issues.\n\n## Contributors\n\n* [@0x64746b](https://github.com/0x64746b)\n* [@lucasmarshall](https://github.com/lucasmarshall)\n* [@amcgregor](https://github.com/amcgregor)\n* [@jhermann](https://github.com/jhermann)\n* [@frenzymadness](https://github.com/frenzymadness)\n* [@chrischambers](https://github.com/chrischambers)\n* [@maxalbert](https://github.com/maxalbert)\n* [@jayvdb](https://github.com/jayvdb)\n\n## License\n\npytest-spec - pytest plugin to display test execution output like a SPECIFICATION.\n\nCopyright (C) 2014-2021 Pawel Chomicki\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\n",
    "bugtrack_url": null,
    "license": "GPL-2.0-or-later",
    "summary": "Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.",
    "version": "3.2.0",
    "project_urls": {
        "Homepage": "https://github.com/pchomik/pytest-spec",
        "Repository": "https://github.com/pchomik/pytest-spec"
    },
    "split_keywords": [
        "pytest",
        "test",
        "unittest",
        "spec"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f099ccc8061043646dd178052e17a6f3ba3c392024694a8a84f2462045745bc5",
                "md5": "95f9f874a654b93099736a1c18995d8c",
                "sha256": "128dd1e133c72d6a18b28ed96d0af0fc43aece8f796ebcfcd81c850f0094b62e"
            },
            "downloads": -1,
            "filename": "pytest_spec-3.2.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "95f9f874a654b93099736a1c18995d8c",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 20675,
            "upload_time": "2021-05-04T09:03:20",
            "upload_time_iso_8601": "2021-05-04T09:03:20.112650Z",
            "url": "https://files.pythonhosted.org/packages/f0/99/ccc8061043646dd178052e17a6f3ba3c392024694a8a84f2462045745bc5/pytest_spec-3.2.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ea9f61c27fbad6cddc593405b072a726ff67c43c4802a54ddb22ffbcb1c25ae5",
                "md5": "b4615a65a63f1248f8abb44ed136166c",
                "sha256": "4af154588195f4bb6c62d6ca030a20218db7d80b675a08897d9a99239ea3d087"
            },
            "downloads": -1,
            "filename": "pytest-spec-3.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b4615a65a63f1248f8abb44ed136166c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16980,
            "upload_time": "2021-05-04T09:03:21",
            "upload_time_iso_8601": "2021-05-04T09:03:21.346152Z",
            "url": "https://files.pythonhosted.org/packages/ea/9f/61c27fbad6cddc593405b072a726ff67c43c4802a54ddb22ffbcb1c25ae5/pytest-spec-3.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-05-04 09:03:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pchomik",
    "github_project": "pytest-spec",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pytest-spec"
}
        
Elapsed time: 0.06792s