https://github.com/uriyyo/pytest-easy-addoption
🔧pytest plugin
https://github.com/uriyyo/pytest-easy-addoption
pytest pytest-plugin python
Last synced: 3 months 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 (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2020-04-15T17:40:58.000Z (about 5 years ago)
- Last Synced: 2025-03-14T03:43:12.203Z (4 months ago)
- Topics: pytest, pytest-plugin, python
- Language: Python
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- 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 =============================