Skip to main content
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/mwA9SRN.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

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.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_pspec-0.0.2-py2.py3-none-any.whl (8.4 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pytest-pspec-0.0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pytest-pspec-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6cacd29aea7e9356926025a388fea5cf2f74692aaa4eb13a0ecd334aa68a3bad
MD5 ce9e15eace5917833227876000efb029
BLAKE2b-256 deaab191f2fad0258deecc8980b05e68bc641a1d9493b86844fe789d3609d905

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_pspec-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1d81733e9da59670580969416149dd117fec79d5d78f62ef3a47a9015f2475cb
MD5 c72bd4e5a72e48ea32f0e344ba0a2e1d
BLAKE2b-256 7ebf8954fb75c70313a1c3ac4eb25e040500cd5a8677b18d2929af4d16a20a98

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.4

2 files

0.0.3

2 files

This release

0.0.2 This release

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page