A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it".
Project description
The pytest-pyspec plugin transforms the pytest output into a result similar to the RSpec.
Just nest your tests using classes and include docstring for each class and test. You can create any nested levels.
The following test sample:
import pytest
class TestHouse:
"a House"
def test_door(self):
"has door"
assert 1 == 1
class TestTwoFloors:
"""with two floors
A house with two floor has stairs
"""
def test_stairs(self):
"has stairs"
assert 1 == 1
def test_second_floor(self):
"has second floor"
assert 1 == 1
def test_third_floor(self):
"has third floor"
assert 1 == 2
Generates the following output:
test/test_sample.py
A house
✓ Has door
A house
With two floors
✓ Has stairs
✓ Has second floor
✗ Has third floor
Installing and running pySpec
pip install pytest-pyspec
pytest --pyspec
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytest_pyspec-0.5.0.tar.gz
(16.0 kB
view hashes)
Built Distribution
Close
Hashes for pytest_pyspec-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b3a130273426205b1350dc4da0fa99030af59f26faa6566a10d3fbefa6a4451 |
|
MD5 | 80e0f5f368c588a1638e9875888cffe8 |
|
BLAKE2b-256 | b0347c8236e08ad9a6e8a3c56f0e3af1812b7eb8299af5be181a36dc8338ad58 |