pytest-pspec
==============
.. image:: https://travis-ci.org/gowtham-sai/pytest-pspec.svg?branch=master
:target: https://travis-ci.org/gowtham-sai/pytest-pspec
.. image:: https://codecov.io/gh/gowtham-sai/pytest-pspec/branch/master/graph/badge.svg
:target: https://codecov.io/gh/gowtham-sai/pytest-pspec
A `pspec format`_ reporter for pytest
.. _pspec format: https://en.wikipedia.org/wiki/RSpec
.. image:: https://i.imgur.com/cCMJXHe.png
Install
-------
::
pip install pytest-pspec
Usage
-----
Add the parameter `--pspec` when running `pytest`. Ex:
::
pytest --pspec your-tests/
Tip: If you don't want to type ``--pspec`` 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>`_. Ex:
.. code-block:: ini
# content of pytest.ini
# (or tox.ini or setup.cfg)
[pytest]
addopts = --pspec
Demo Code
---------
Add the doc strings Ex:
.. code-block:: python
import unittest
class TestWayTwo(unittest.TestCase):
"Pspec Python TDD"
def test_should_add(self):
"it adds two integers and returns integer"
self.assertEqual(2+2, 4)
def test_should_find_difference_between_integers(self):
self.assertEqual(4-2, 2)
running ``pytest --pspec`` outputs
.. code-block::
demo
✓ it adds two integers and returns integer
✓ should find difference between integers
Configuration file options
--------------------------
pspec\_format
~~~~~~~~~~~~~~~
Specifies pspec report format, ``plaintext`` or ``utf8`` (default:
``utf8``). Ex:
.. code:: ini
# content of pytest.ini
# (or tox.ini or setup.cfg)
[pytest]
pspec_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: pspec-dev
collected 2 items
test_demo.py
Pytest pspec
[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/gowtham-sai/pytest-pspec",
"name": "pytest-pspec",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pytest pspec test report bdd rspec",
"author": "Gowtham Sai",
"author_email": "hello@gowtham-sai.com",
"download_url": "https://files.pythonhosted.org/packages/cc/e1/c22cf2cdd39dfdc5b482e3f11754a3646b5bb8d6e5bc50b5722322574016/pytest-pspec-0.0.4.tar.gz",
"platform": "",
"description": "pytest-pspec\n==============\n\n.. image:: https://travis-ci.org/gowtham-sai/pytest-pspec.svg?branch=master\n :target: https://travis-ci.org/gowtham-sai/pytest-pspec\n\n.. image:: https://codecov.io/gh/gowtham-sai/pytest-pspec/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/gowtham-sai/pytest-pspec\n\nA `pspec format`_ reporter for pytest\n\n.. _pspec format: https://en.wikipedia.org/wiki/RSpec\n\n.. image:: https://i.imgur.com/cCMJXHe.png\n\nInstall\n-------\n\n::\n\n pip install pytest-pspec\n\n\nUsage\n-----\n\nAdd the parameter `--pspec` when running `pytest`. Ex:\n\n::\n\n pytest --pspec your-tests/\n\nTip: If you don't want to type ``--pspec`` 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>`_. Ex:\n\n.. code-block:: ini\n\n # content of pytest.ini\n # (or tox.ini or setup.cfg)\n [pytest]\n addopts = --pspec\n\n\nDemo Code\n---------\n\nAdd the doc strings Ex:\n\n.. code-block:: python\n\n import unittest\n\n class TestWayTwo(unittest.TestCase):\n \"Pspec Python TDD\"\n\n def test_should_add(self):\n \"it adds two integers and returns integer\"\n self.assertEqual(2+2, 4)\n\n def test_should_find_difference_between_integers(self):\n self.assertEqual(4-2, 2)\n\nrunning ``pytest --pspec`` outputs\n\n.. code-block::\n\n demo\n \u2713 it adds two integers and returns integer\n \u2713 should find difference between integers\n\n\n\nConfiguration file options\n--------------------------\n\npspec\\_format\n~~~~~~~~~~~~~~~\n\nSpecifies pspec report format, ``plaintext`` or ``utf8`` (default:\n``utf8``). Ex:\n\n.. code:: ini\n\n # content of pytest.ini\n # (or tox.ini or setup.cfg)\n [pytest]\n pspec_format = plaintext\n\n::\n\n $ pytest test_demo.py\n ============================= test session starts ==============================\n platform darwin -- Python 3.5.0, pytest-3.0.7, py-1.4.33, pluggy-0.4.0\n rootdir: /private/tmp/demo, inifile: pytest.ini\n plugins: pspec-dev\n collected 2 items\n\n test_demo.py\n Pytest pspec\n [x] prints a BDD style output to your tests\n [x] lets you focus on the behavior\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A rspec format reporter for Python ptest",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/gowtham-sai/pytest-pspec"
},
"split_keywords": [
"pytest",
"pspec",
"test",
"report",
"bdd",
"rspec"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "91e41b8cd89205c84f46bc4240eb86840bf2b6729db95c2ede712abc7226c5ff",
"md5": "45760e8075dc3288c4218b0aa35e08f8",
"sha256": "f80cc46f8896524bfe68750f3a5324bad8d4cb5112e90004bfdaafb7248e5cfd"
},
"downloads": -1,
"filename": "pytest_pspec-0.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "45760e8075dc3288c4218b0aa35e08f8",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 7313,
"upload_time": "2020-06-02T17:13:19",
"upload_time_iso_8601": "2020-06-02T17:13:19.183068Z",
"url": "https://files.pythonhosted.org/packages/91/e4/1b8cd89205c84f46bc4240eb86840bf2b6729db95c2ede712abc7226c5ff/pytest_pspec-0.0.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cce1c22cf2cdd39dfdc5b482e3f11754a3646b5bb8d6e5bc50b5722322574016",
"md5": "b4426989b8281015ccd4320ee9e88fd3",
"sha256": "5c0b0c9e964d5066cc5f2a2e1b296ad1313abbf58c4fd75014553fdf65bfe67a"
},
"downloads": -1,
"filename": "pytest-pspec-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "b4426989b8281015ccd4320ee9e88fd3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5268,
"upload_time": "2020-06-02T17:13:20",
"upload_time_iso_8601": "2020-06-02T17:13:20.166164Z",
"url": "https://files.pythonhosted.org/packages/cc/e1/c22cf2cdd39dfdc5b482e3f11754a3646b5bb8d6e5bc50b5722322574016/pytest-pspec-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-06-02 17:13:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gowtham-sai",
"github_project": "pytest-pspec",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "pytest-pspec"
}