Created
August 25, 2017 04:50
-
-
Save kangeugine/89e8ad35b0e91959e6364c04c23baf49 to your computer and use it in GitHub Desktop.
PyTest fixture
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
| 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