Skip to main content

A rspec format reporter for Python ptest

Project description

https://travis-ci.org/gowtham-sai/pytest-pspec.svg?branch=master https://codecov.io/gh/gowtham-sai/pytest-pspec/branch/master/graph/badge.svg

A pspec format reporter for pytest

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 in your ini file. Ex:

# content of pytest.ini
# (or tox.ini or setup.cfg)
[pytest]
addopts = --pspec

Demo Code

Add the doc strings Ex:

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

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:

# 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

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

pytest-pspec-0.0.4.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

pytest_pspec-0.0.4-py2.py3-none-any.whl (7.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-pspec-0.0.4.tar.gz.

File metadata

  • Download URL: pytest-pspec-0.0.4.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.7

File hashes

Hashes for pytest-pspec-0.0.4.tar.gz
Algorithm Hash digest
SHA256 5c0b0c9e964d5066cc5f2a2e1b296ad1313abbf58c4fd75014553fdf65bfe67a
MD5 b4426989b8281015ccd4320ee9e88fd3
BLAKE2b-256 cce1c22cf2cdd39dfdc5b482e3f11754a3646b5bb8d6e5bc50b5722322574016

See more details on using hashes here.

File details

Details for the file pytest_pspec-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_pspec-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.7

File hashes

Hashes for pytest_pspec-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f80cc46f8896524bfe68750f3a5324bad8d4cb5112e90004bfdaafb7248e5cfd
MD5 45760e8075dc3288c4218b0aa35e08f8
BLAKE2b-256 91e41b8cd89205c84f46bc4240eb86840bf2b6729db95c2ede712abc7226c5ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page