Created
October 18, 2020 16:44
-
-
Save tjkhara/a17b8db116180196a4a4bbac5febb3f2 to your computer and use it in GitHub Desktop.
Fixture class scope
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(scope="module", autouse=True) | |
| def setupModule2(): | |
| print("\nSetup module2") | |
| @pytest.fixture(scope="class", autouse=True) | |
| def setupClass2(): | |
| print("\nSetup Class2") | |
| @pytest.fixture(scope="function", autouse=True) | |
| def setupFunction2(): | |
| print("\nSetup Function 2") | |
| class TestClass: | |
| def test_it(self): | |
| print("Test it") | |
| assert True | |
| def test_it2(self): | |
| print("Test it 2") | |
| assert True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment