We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 693e9d0 commit 1873dc6Copy full SHA for 1873dc6
doc/en/fixture.rst
@@ -391,7 +391,12 @@ close all resources created by a fixture even if one of them fails to be created
391
392
import pytest
393
394
- from .utils import connect
+
395
+ @contextlib.contextmanager
396
+ def connect(port):
397
+ ... # create connection
398
+ yield
399
+ ... # close connection
400
401
402
@pytest.fixture
@@ -441,7 +446,12 @@ Here's the ``equipments`` fixture changed to use ``addfinalizer`` for cleanup:
441
446
442
447
443
448
444
449
450
451
452
453
454
445
455
456
457
0 commit comments