I'm trying to create a Pytest Fixture and have "user_type" argument within the fixture. And then evaluate the passed argument in if statement.
conftest.py
import pytest
# Some custom modules...
@pytest.fixture
def generate_random_user(_db, user_type):
# Do stuff
if user_type == "no-subscription":
# Do stuffs
yield _db
_db.drop_all()
elif user_type == "with-subscription":
pass
test.py
@pytest.mark.usefixtures("live_server", "client")
def test_checkout_new_customer(selenium, generate_random_user("no-subscription")):
pass