Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uriyyo/pytest-easy-addoption
🔧pytest plugin
https://github.com/uriyyo/pytest-easy-addoption
pytest pytest-plugin python
Last synced: 20 days ago
JSON representation
🔧pytest plugin
- Host: GitHub
- URL: https://github.com/uriyyo/pytest-easy-addoption
- Owner: uriyyo
- License: mit
- Created: 2019-12-23T08:33:32.000Z (almost 5 years ago)
- Default Branch: develop
- Last Pushed: 2020-04-15T17:40:58.000Z (over 4 years ago)
- Last Synced: 2024-10-10T19:08:16.850Z (about 1 month ago)
- Topics: pytest, pytest-plugin, python
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
.. raw:: html
Pytest-Easy-Addoption
``pytest-easy-addoption`` pytest addoption but with power of type annotations and dataclasses.
More documentation `here `_.
To install ``pytest-easy-addoption`` simply:
.. code-block:: bash
$ pip install pytest-easy-addoption
An quick example of a usage:
.. code-block:: python
from pytest_easy_addoption import AddOption
class FooBarAddOption(AddOption):
foo: str
bar: str = 'BAR'
def pytest_addoption(parser):
FooBarAddOption.register(parser).. code-block:: python
from .conftest import FooBarAddOption
def test_example(request):
print(FooBarAddOption())::
$ pytest --foo="FOO"
============================= test session starts =============================
collected 1 itemstest_sample.py FooBarAddOption(foo='FOO', bar='BAR')
.============================= 1 passed in 0.03s =============================