Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

.. raw:: html

Pytest-Easy-Addoption


Code Style
License: MIT
Contributions
Build Status
Coverage

``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 items

test_sample.py FooBarAddOption(foo='FOO', bar='BAR')
.

============================= 1 passed in 0.03s =============================