Skip to content

Instantly share code, notes, and snippets.

@BeyondEvil
Created June 19, 2019 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeyondEvil/e831435123f1c64009c7c25d8a49485d to your computer and use it in GitHub Desktop.
Save BeyondEvil/e831435123f1c64009c7c25d8a49485d to your computer and use it in GitHub Desktop.
import pytest
@pytest.fixture(scope="module")
def module_function():
yield [1,2,3]
@pytest.fixture(scope="function")
def function_function(module_function):
return module_function
def test_something(function_function):
assert function_function == [1,2,3]
def test_something_else(function_function):
assert function_function == []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment