Is it possible to have a fixture that returns a dictionary and dataframe?
import somefile
import pytest
@pytest.fixture()
def setup():
dictionary, dataframe = somefile.get_Di_And_Df()
return(dictionary, dataframe)
def test_check(setup):
assert dictionary['movie']['action'] == 'Avengers'
assert dataframe.shape[0] == 5
The return value (or yield value) of the fixture is literally the object injected as a function argument during test execution:
def test_check(setup):
dictionary, dataframe = setup
assert dictionary['movie']['action'] == 'Avengers'
assert dataframe.shape[0] == 5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With