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 setting PYTEST_DISABLE_PLUGIN_AUTOLOAD. That way, I can simply use that for the addopts property of the configuration;
- Have an option in the configuration for defining environment variables. Then I could set
PYTEST_DISABLE_PLUGIN_AUTOLOAD there;
- 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
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_AUTOLOADwhen 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:
--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;PYTEST_DISABLE_PLUGIN_AUTOLOADthere;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