Skip to content

Instantly share code, notes, and snippets.

@tjkhara
Created October 18, 2020 16:44
Show Gist options
  • Select an option

  • Save tjkhara/a17b8db116180196a4a4bbac5febb3f2 to your computer and use it in GitHub Desktop.

Select an option

Save tjkhara/a17b8db116180196a4a4bbac5febb3f2 to your computer and use it in GitHub Desktop.
Fixture class scope
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