Skip to main content

A rspec format reporter for Python ptest

Project description

https://travis-ci.org/gowtham-sai/pytest-pspec.svg?branch=master

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

Project details


Release history Release notifications

This version
History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pytest_pspec-0.0.3-py2.py3-none-any.whl (8.4 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jan 22, 2018
pytest-pspec-0.0.3.tar.gz (5.3 kB) Copy SHA256 hash SHA256 Source None Jan 22, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page