-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
type: 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
Allow scope parameter of fixtures to receive a callable instead of a string. When a callable, it will be called with the config object (passed as keyword argument) and should return a string, which will determine the scope of the fixture. This function will evaluate only once.
The idea is that developers might be interested to have different scopes for a fixture depending on a command line option, so that one might choose to change a fixture scope to session to avoid costly initialization during development, but opt to change it to function in a C.I. server.
Suggested by @hpk42
dmitrytokarev85, xsandr, rosariomgomez, itaykatz, springheeledjak and 10 moredmitrytokarev85, springheeledjak, robertrmartinez, egabrum, izapolsk and 2 more
Metadata
Metadata
Assignees
Labels
type: 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