Pytest fixture inject data
import pytest
@pytest.fixture()
def config():
return {
'name' : 'Foo Bar',
'email' : 'foo@bar.com',
}
def test_some_data(config):
assert True
print(config)
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
import pytest
@pytest.fixture()
def config():
return {
'name' : 'Foo Bar',
'email' : 'foo@bar.com',
}
def test_some_data(config):
assert True
print(config)