Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #37 from uber/ca/add_pytest_doc
Browse files Browse the repository at this point in the history
Add doc for pytest
  • Loading branch information
charlax committed Feb 4, 2015
2 parents 064d144 + ee954ca commit 92c6263
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,30 @@ For a single test
# Do things... and optionally uninstall it once you're done
self.uninstall_fixture("toaster")
With pytest
"""""""""""

It's extremely easy to use charlatan with pytest. There are multiple ways to
achieve nice readability, here's one possibility.

In ``conftest.py``:

.. code-block:: python
@pytest.fixture
def get_fixture():
return fixtures_manager.get_fixture
In your test file:

.. code-block:: python
def test_toaster(get_fixture):
"""Verify that a toaster toasts."""
toaster = get_fixture('toaster')
toast = get_fixture('toast')
...
Getting a fixture without saving it
"""""""""""""""""""""""""""""""""""

Expand Down

0 comments on commit 92c6263

Please sign in to comment.