A pspec format reporter for pytest
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
Metadata
Release files for pytest-pspec 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest-pspec-0.0.3.tar.gz | 5.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_pspec-0.0.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 13.7 kB
Release files / pytest-pspec-0.0.3.tar.gz
| Download URL | pytest-pspec-0.0.3.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14274721d4b1ac500a7d133c7a84af26b921dbe942dbf175512ae16225647968
|
|
BLAKE2b-256 checksum How to use checksums |
78c7ae7ad32a39f30afbe9eb358df5c8a97d1d59aad34ebd3cd9e5e88325dce1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pytest_pspec-0.0.3-py2.py3-none-any.whl
| Download URL | pytest_pspec-0.0.3-py2.py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6302a692fe3ebd5ee6aea6e458f2455ba8768b57d4571118a28d8d5bbdbb57d0
|
|
BLAKE2b-256 checksum How to use checksums |
a423f3ecc5c21ed6a385623a891dd2ba6079b58b021192d5375fc14fa84f1588
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |