pytest-aspec


Namepytest-aspec JSON
Version 1.3 PyPI version JSON
download
home_pagehttps://github.com/angry-penguins/pytest-aspec
SummaryA rspec format reporter for pytest
upload_time2023-12-20 15:19:22
maintainer
docs_urlNone
author2ps
requires_python
license
keywords pytest pspec test report bdd rspec
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pytest_aspec
==============

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_aspec


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\_passed
~~~~~~~~~~~~~~~

Specifies pspec passed character. Ex:

.. code:: ini

    # content of pytest.ini
    # (or tox.ini or setup.cfg)
    [pytest]
    pspec_passed=\N{heavy check mark}\N{vs16}

::

    $ 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
     ✔️ prints a BDD style output to your tests
     ✔️ lets you focus on the behavior

pspec\_failed
~~~~~~~~~~~~~~~

Specifies pspec failed character. Ex:

.. code:: ini

    # content of pytest.ini
    # (or tox.ini or setup.cfg)
    [pytest]
    pspec_failed=\N{skull and crossbones}\N{vs16}

::

    $ 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
     🌸️ this failed??!!

pspec\_skipped
~~~~~~~~~~~~~~~

Specifies pspec skipped character. Ex:

.. code:: ini

    # content of pytest.ini
    # (or tox.ini or setup.cfg)
    [pytest]
    pspec_skipped=\N{snowman without snow}\N{vs16}

::

    $ 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
     ☃️️ skipping this test for now

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/angry-penguins/pytest-aspec",
    "name": "pytest-aspec",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pytest pspec test report bdd rspec",
    "author": "2ps",
    "author_email": "p.shingavi@yahoo.com",
    "download_url": "https://files.pythonhosted.org/packages/4b/48/ff6a4156bd8c33c3f2fe6545c3efd4c3e9758555f5b3614aa344512ee84a/pytest_aspec-1.3.tar.gz",
    "platform": null,
    "description": "pytest_aspec\n==============\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_aspec\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     \ud83c\udf38 it adds two integers and returns integer\n     \ud83c\udf38 should find difference between integers\n\n\n\nConfiguration file options\n--------------------------\n\npspec\\_passed\n~~~~~~~~~~~~~~~\n\nSpecifies pspec passed character. Ex:\n\n.. code:: ini\n\n    # content of pytest.ini\n    # (or tox.ini or setup.cfg)\n    [pytest]\n    pspec_passed=\\N{heavy check mark}\\N{vs16}\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     \u2714\ufe0f prints a BDD style output to your tests\n     \u2714\ufe0f lets you focus on the behavior\n\npspec\\_failed\n~~~~~~~~~~~~~~~\n\nSpecifies pspec failed character. Ex:\n\n.. code:: ini\n\n    # content of pytest.ini\n    # (or tox.ini or setup.cfg)\n    [pytest]\n    pspec_failed=\\N{skull and crossbones}\\N{vs16}\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     \ud83c\udf38\ufe0f this failed??!!\n\npspec\\_skipped\n~~~~~~~~~~~~~~~\n\nSpecifies pspec skipped character. Ex:\n\n.. code:: ini\n\n    # content of pytest.ini\n    # (or tox.ini or setup.cfg)\n    [pytest]\n    pspec_skipped=\\N{snowman without snow}\\N{vs16}\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     \u2603\ufe0f\ufe0f skipping this test for now\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A rspec format reporter for pytest",
    "version": "1.3",
    "project_urls": {
        "Homepage": "https://github.com/angry-penguins/pytest-aspec"
    },
    "split_keywords": [
        "pytest",
        "pspec",
        "test",
        "report",
        "bdd",
        "rspec"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b48ff6a4156bd8c33c3f2fe6545c3efd4c3e9758555f5b3614aa344512ee84a",
                "md5": "86ce5ed150d56e7c6546f74f1a8ac7b4",
                "sha256": "50fd461551f2a35448e49af6fdfeb2e7b1eb45d361bc0250fed2cfd20ccedd9b"
            },
            "downloads": -1,
            "filename": "pytest_aspec-1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "86ce5ed150d56e7c6546f74f1a8ac7b4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4758,
            "upload_time": "2023-12-20T15:19:22",
            "upload_time_iso_8601": "2023-12-20T15:19:22.279545Z",
            "url": "https://files.pythonhosted.org/packages/4b/48/ff6a4156bd8c33c3f2fe6545c3efd4c3e9758555f5b3614aa344512ee84a/pytest_aspec-1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-20 15:19:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "angry-penguins",
    "github_project": "pytest-aspec",
    "github_not_found": true,
    "lcname": "pytest-aspec"
}
        
2ps
Elapsed time: 1.91612s