Questions tagged [fixture-scope]
1 questions
0
votes
1 answer
function vs class vs module vs package vs session for fixture scopes in Pytest
I set 5 fixtures with function, class, module, package and session scopes to test1() as shown below:
import pytest
@pytest.fixture(scope='function')
def fixture_function():
print('function')
@pytest.fixture(scope='class')
def fixture_class():
…

Super Kai - Kazuya Ito
- 22,221
- 10
- 124
- 129