Last active
July 16, 2020 04:14
-
-
Save Sharadh/590215d0d53611974f07f027066e9f67 to your computer and use it in GitHub Desktop.
Code snippet to accompany blogpost on 5 pytest best practices
This file contains 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
import pytest | |
@pytest.fixture | |
def first(): | |
print("Set up first fixture") | |
yield | |
print("Clean up first fixture") | |
@pytest.fixture | |
def second(first): | |
print("Set up second fixture") | |
yield | |
print("Clean up second fixture") | |
def test_context_fixture_order(second): | |
print("In the test") | |
assert False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment