Skip to content

Instantly share code, notes, and snippets.

@kangeugine
Created August 25, 2017 04:50
Show Gist options
  • Select an option

  • Save kangeugine/89e8ad35b0e91959e6364c04c23baf49 to your computer and use it in GitHub Desktop.

Select an option

Save kangeugine/89e8ad35b0e91959e6364c04c23baf49 to your computer and use it in GitHub Desktop.
PyTest fixture
import pytest
@pytest.fixture
def default_list():
return [1, 2]
def test_fixture_1(default_list):
del default_list[0]
assert default_list == [2]
def test_fixture_2(default_list):
assert len(default_list) == 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment