Last active
August 23, 2016 05:32
-
-
Save meejah/78f29b41931913c5e21813e3a669316d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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