-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
topic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature
Description
This is a feature request. I would like to be able to dynamically generate fixtures, similar to parameterized fixtures, but instead of running all associated tests with each fixture, expose each fixture dynamically. The syntax could use work, but i.e.:
@pytest.fixture(scope='module',
generate=['user', 'admin'],
params=[User, Admin])
def session(SessionType):
return SessionType()
def test_authorization(session_user, session_admin):
with pytest.raises(Exception):
session_user.do_admin_thing()
assert session_admin.do_admin_thing()
Metadata
Metadata
Assignees
Labels
topic: fixturesanything involving fixtures directly or indirectlyanything involving fixtures directly or indirectlytype: proposalproposal for a new feature, often to gather opinions or design the API around the new featureproposal for a new feature, often to gather opinions or design the API around the new feature