Skip to content

Instantly share code, notes, and snippets.

@meejah meejah/conftest.py
Last active Aug 23, 2016

Embed
What would you like to do?
from __future__ import print_function
import pytest
@pytest.hookimpl(hookwrapper=True)
def pytest_fixture_setup(fixturedef, request):
print("pytest_fixture_setup before", fixturedef, request)
yield
print("pytest_fixture_setup after", fixturedef, request)
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_setup(item):
print("BEFORE", item)
yield
print("AFTER", item)
@pytest.fixture
def a_fixture():
import time
time.sleep(2)
return "nothing"
def test_foo(a_fixture):
print("inside test_foo", a_fixture)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.