All Projects → TvoroG → Pytest Lazy Fixture

TvoroG / Pytest Lazy Fixture

Licence: mit
It helps to use fixtures in pytest.mark.parametrize

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Pytest Lazy Fixture

Pytest Patterns
A couple of examples showing how pytest and its plugins can be combined to solve real-world needs.
Stars: ✭ 24 (-86.59%)
Mutual labels:  test, pytest
python-pytest-harvest
Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes.
Stars: ✭ 44 (-75.42%)
Mutual labels:  test, pytest
Pytest Spec
Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION.
Stars: ✭ 65 (-63.69%)
Mutual labels:  test, pytest
emacs-python-pytest
run pytest inside emacs
Stars: ✭ 105 (-41.34%)
Mutual labels:  test, pytest
Python Pytest Cases
Separate test code from test cases in pytest.
Stars: ✭ 127 (-29.05%)
Mutual labels:  test, pytest
Automationtest
Pytest测试框架,UI, API, DataBase,部分功能已封装,可根据实际需求修改
Stars: ✭ 159 (-11.17%)
Mutual labels:  pytest
Pudb
Full-screen console debugger for Python
Stars: ✭ 2,267 (+1166.48%)
Mutual labels:  pytest
Machine Learning With Python
Practice and tutorial-style notebooks covering wide variety of machine learning techniques
Stars: ✭ 2,197 (+1127.37%)
Mutual labels:  pytest
Nbmake Action
GitHub Action for testing notebooks
Stars: ✭ 151 (-15.64%)
Mutual labels:  test
Preact Render Spy
Render preact components with access to the produced virtual dom for testing.
Stars: ✭ 178 (-0.56%)
Mutual labels:  test
Reactor Addons
Official modules for the Reactor project
Stars: ✭ 175 (-2.23%)
Mutual labels:  test
Expekt
BDD assertion library for Kotlin
Stars: ✭ 163 (-8.94%)
Mutual labels:  test
Allure Pytest
Deprecated, please use https://github.com/allure-framework/allure-python instead
Stars: ✭ 159 (-11.17%)
Mutual labels:  pytest
Awesome Pytest
A curated list of awesome pytest resources
Stars: ✭ 170 (-5.03%)
Mutual labels:  pytest
Rx Sandbox
Marble diagram DSL based test suite for RxJS 6
Stars: ✭ 151 (-15.64%)
Mutual labels:  test
Testen
✔️ Run tests for multiple versions of Node.js in local env.
Stars: ✭ 176 (-1.68%)
Mutual labels:  test
Swagger meqa
Auto generate and run tests using swagger/OpenAPI spec, no coding needed
Stars: ✭ 151 (-15.64%)
Mutual labels:  test
Pytest Tricks
😏 Tips and Tricks for the Python Testing Tool
Stars: ✭ 162 (-9.5%)
Mutual labels:  pytest
Pytest Flask Sqlalchemy
A pytest plugin for preserving test isolation in Flask-SQLAlchemy using database transactions.
Stars: ✭ 168 (-6.15%)
Mutual labels:  pytest
Chai Immutable
Chai assertions for Facebook's Immutable library for JavaScript collections
Stars: ✭ 161 (-10.06%)
Mutual labels:  test

pytest-lazy-fixture |travis-ci| |appveyor| |pypi|

Use your fixtures in @pytest.mark.parametrize.

Installation

.. code-block:: shell

pip install pytest-lazy-fixture

Usage

.. code-block:: python

import pytest

@pytest.fixture(params=[1, 2])
def one(request):
    return request.param

@pytest.mark.parametrize('arg1,arg2', [
    ('val1', pytest.lazy_fixture('one')),
])
def test_func(arg1, arg2):
    assert arg2 in [1, 2]

Also you can use it as a parameter in @pytest.fixture:

.. code-block:: python

import pytest

@pytest.fixture(params=[
    pytest.lazy_fixture('one'),
    pytest.lazy_fixture('two')
])
def some(request):
    return request.param

@pytest.fixture
def one():
    return 1

@pytest.fixture
def two():
    return 2

def test_func(some):
    assert some in [1, 2]

Please see tests <https://github.com/TvoroG/pytest-lazy-fixture/blob/master/tests/test_lazyfixture.py>_ for more examples.

Contributing

Contributions are very welcome. Tests can be run with tox.

License

Distributed under the terms of the MIT license, pytest-lazy-fixture is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

.. |travis-ci| image:: https://travis-ci.org/TvoroG/pytest-lazy-fixture.svg?branch=master :target: https://travis-ci.org/TvoroG/pytest-lazy-fixture .. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/TvoroG/pytest-fixture-mark?branch=master&svg=true :target: https://ci.appveyor.com/project/TvoroG/pytest-fixture-mark .. |pypi| image:: https://badge.fury.io/py/pytest-lazy-fixture.svg :target: https://pypi.python.org/pypi/pytest-lazy-fixture/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].