pytest-pyspec 0.4.2__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_pyspec-0.4.2 → pytest_pyspec-0.5.1}/PKG-INFO +4 -3
- {pytest_pyspec-0.4.2 → pytest_pyspec-0.5.1}/README.md +2 -2
- {pytest_pyspec-0.4.2 → pytest_pyspec-0.5.1}/pyproject.toml +2 -2
- {pytest_pyspec-0.4.2 → pytest_pyspec-0.5.1}/pytest_pyspec/item.py +4 -3
- {pytest_pyspec-0.4.2 → pytest_pyspec-0.5.1}/pytest_pyspec/plugin.py +10 -0
- pytest_pyspec-0.4.2/setup.py +0 -34
- {pytest_pyspec-0.4.2 → pytest_pyspec-0.5.1}/LICENSE +0 -0
- {pytest_pyspec-0.4.2 → pytest_pyspec-0.5.1}/pytest_pyspec/__init__.py +0 -0
- {pytest_pyspec-0.4.2 → pytest_pyspec-0.5.1}/pytest_pyspec/output.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pytest-pyspec
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: A
|
|
3
|
+
Version: 0.5.1
|
|
4
|
+
Summary: 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".
|
|
5
5
|
Home-page: https://github.com/felipecrp/pytest-pyspec
|
|
6
6
|
License: GPL-3.0-only
|
|
7
7
|
Author: Felipe Curty
|
|
@@ -18,7 +18,7 @@ Project-URL: Repository, https://github.com/felipecrp/pytest-pyspec
|
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
The **
|
|
21
|
+
The **pytest-pyspec** plugin transforms the pytest output into a result similar to the RSpec.
|
|
22
22
|
|
|
23
23
|
Just nest your tests using classes and include _docstring_ for each class and test. You can create any nested levels.
|
|
24
24
|
|
|
@@ -73,3 +73,4 @@ A house
|
|
|
73
73
|
pip install pytest-pyspec
|
|
74
74
|
pytest --pyspec
|
|
75
75
|
```
|
|
76
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
The **
|
|
2
|
+
The **pytest-pyspec** plugin transforms the pytest output into a result similar to the RSpec.
|
|
3
3
|
|
|
4
4
|
Just nest your tests using classes and include _docstring_ for each class and test. You can create any nested levels.
|
|
5
5
|
|
|
@@ -53,4 +53,4 @@ A house
|
|
|
53
53
|
```bash
|
|
54
54
|
pip install pytest-pyspec
|
|
55
55
|
pytest --pyspec
|
|
56
|
-
```
|
|
56
|
+
```
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "pytest-pyspec"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "A
|
|
3
|
+
version = "0.5.1"
|
|
4
|
+
description = "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\"."
|
|
5
5
|
authors = ["Felipe Curty <felipecrp@gmail.com>"]
|
|
6
6
|
license = "GPL-3.0-only"
|
|
7
7
|
readme = "README.md"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from types import ModuleType
|
|
2
|
+
from typing import Dict, List
|
|
2
3
|
import pytest
|
|
3
4
|
|
|
4
5
|
class Item:
|
|
@@ -58,8 +59,8 @@ class Test(Item):
|
|
|
58
59
|
class Container(Item):
|
|
59
60
|
def __init__(self, item: pytest.Item):
|
|
60
61
|
super().__init__(item)
|
|
61
|
-
self.tests = list
|
|
62
|
-
self.containers = list
|
|
62
|
+
self.tests: List[Test] = list()
|
|
63
|
+
self.containers: List[Container] = list()
|
|
63
64
|
self.parent = None
|
|
64
65
|
|
|
65
66
|
def add(self, test: Test):
|
|
@@ -106,7 +107,7 @@ class ItemFactory:
|
|
|
106
107
|
|
|
107
108
|
class ContainerFactory:
|
|
108
109
|
def __init__(self) -> None:
|
|
109
|
-
self.containers
|
|
110
|
+
self.containers: Dict[str, Container] = dict()
|
|
110
111
|
|
|
111
112
|
def create(self, item) -> Container:
|
|
112
113
|
containers = self._create_containers(item)
|
|
@@ -20,6 +20,16 @@ def pytest_configure(config: pytest.Config):
|
|
|
20
20
|
if config.getoption('pyspec') and not config.getoption('verbose'):
|
|
21
21
|
enabled = True
|
|
22
22
|
|
|
23
|
+
python_functions = config.getini("python_functions")
|
|
24
|
+
python_functions.append('it_')
|
|
25
|
+
config.option.python_functions = python_functions
|
|
26
|
+
|
|
27
|
+
python_classes = config.getini("python_classes")
|
|
28
|
+
python_classes.append('describe_')
|
|
29
|
+
python_classes.append('with_')
|
|
30
|
+
config.option.python_classes = python_classes
|
|
31
|
+
|
|
32
|
+
|
|
23
33
|
|
|
24
34
|
test_key = pytest.StashKey[Test]()
|
|
25
35
|
prev_test_key = pytest.StashKey[Test]()
|
pytest_pyspec-0.4.2/setup.py
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
from setuptools import setup
|
|
3
|
-
|
|
4
|
-
packages = \
|
|
5
|
-
['pytest_pyspec']
|
|
6
|
-
|
|
7
|
-
package_data = \
|
|
8
|
-
{'': ['*']}
|
|
9
|
-
|
|
10
|
-
install_requires = \
|
|
11
|
-
['pytest>=7.2.1,<8.0.0']
|
|
12
|
-
|
|
13
|
-
entry_points = \
|
|
14
|
-
{'pytest11': ['pytest_pyspec = pytest_pyspec.plugin']}
|
|
15
|
-
|
|
16
|
-
setup_kwargs = {
|
|
17
|
-
'name': 'pytest-pyspec',
|
|
18
|
-
'version': '0.4.2',
|
|
19
|
-
'description': 'A python test spec based on pytest',
|
|
20
|
-
'long_description': '\nThe **pySpec** plugin transforms the pytest output into RSpec.\n\nJust nest your tests using classes and include _docstring_ for each class and test. You can create any nested levels.\n\nThe following test sample:\n\n```python\nimport pytest\n\nclass TestHouse:\n "a House"\n \n def test_door(self):\n "has door"\n assert 1 == 1\n \n class TestTwoFloors:\n """with two floors\n \n A house with two floor has stairs\n """\n def test_stairs(self):\n "has stairs"\n assert 1 == 1\n\n def test_second_floor(self):\n "has second floor"\n assert 1 == 1\n\n def test_third_floor(self):\n "has third floor"\n assert 1 == 2\n```\n\nGenerates the following output:\n\n```\ntest/test_sample.py \n\nA house\n ✓ Has door\n\nA house\n With two floors\n ✓ Has stairs\n ✓ Has second floor\n ✗ Has third floor\n```\n\n## Installing and running **pySpec**\n\n```bash\npip install pytest-pyspec\npytest --pyspec\n```',
|
|
21
|
-
'author': 'Felipe Curty',
|
|
22
|
-
'author_email': 'felipecrp@gmail.com',
|
|
23
|
-
'maintainer': 'None',
|
|
24
|
-
'maintainer_email': 'None',
|
|
25
|
-
'url': 'https://github.com/felipecrp/pytest-pyspec',
|
|
26
|
-
'packages': packages,
|
|
27
|
-
'package_data': package_data,
|
|
28
|
-
'install_requires': install_requires,
|
|
29
|
-
'entry_points': entry_points,
|
|
30
|
-
'python_requires': '>=3.8,<4.0',
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
setup(**setup_kwargs)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|