-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
topic: configrelated to config handling, argument parsing and config filerelated to config handling, argument parsing and config filetype: 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
What's the problem this feature will solve?
I want to use a plugin only when certain conditions are met. Currently, in order to do that I can set the environment variable PYTEST_DISABLE_PLUGIN_AUTOLOAD when calling pytest. Since disabling autoload is the "common path" for the project I'm working on, it would be very convenient to have a way to specify that in the configuration file.
Describe the solution you'd like
I can think of some solutions for this problem:
- Have a CLI option (e.g.
--disable-plugin-autoload) with the same semantics as for settingPYTEST_DISABLE_PLUGIN_AUTOLOAD. That way, I can simply use that for theaddoptsproperty of the configuration; - Have an option in the configuration for defining environment variables. Then I could set
PYTEST_DISABLE_PLUGIN_AUTOLOADthere; - Having a specific option in the configuration for disabling autoload.
Out of the three options above, I'm leaning more toward option (1) because (i) it would also allow disabling autoload from the command line without having to prefix the command with the env var assignment; and (ii) it does not require a new configuration option.
Best regards,
Gustavo Sousa
estahn, gpshead and meshy
Metadata
Metadata
Assignees
Labels
topic: configrelated to config handling, argument parsing and config filerelated to config handling, argument parsing and config filetype: 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