Fix fixture example in docs

This commit is contained in:
Bruno Oliveira 2019-07-23 09:42:05 -04:00
parent 693e9d0733
commit 1873dc6a8a
1 changed files with 12 additions and 2 deletions

View File

@ -391,7 +391,12 @@ close all resources created by a fixture even if one of them fails to be created
import pytest
from .utils import connect
@contextlib.contextmanager
def connect(port):
... # create connection
yield
... # close connection
@pytest.fixture
@ -441,7 +446,12 @@ Here's the ``equipments`` fixture changed to use ``addfinalizer`` for cleanup:
import pytest
from .utils import connect
@contextlib.contextmanager
def connect(port):
... # create connection
yield
... # close connection
@pytest.fixture