-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Extend Config to override ini values programmatically #3311
Description
Hello, I'm trying to find a way to override custom ini values defined inside pytest.ini.
My scenario is the following: I have a custom option called --resource-enable which is implemented inside a plugin called "resources.py". If --resource-enable is used, my plugin fetch the configuration from a DB (dict type) and it has to override the pytest.ini variables defined inside the other plugins which expose the fixtures.
The system is needed in order to accomplish a complex automation scenario using Jenkins and some other proprietary tools.
In short:
- all plugins implement fixtures which are used by the tests, using custom ini values defined inside pytest.ini
- resources.py plugin fetches data from DB and override custom pytest.ini values before the tests execution
At the moment, there are no other ways but using config.addinivalue_line, but most of my ini items have the simple key=value form. A config.addinivalue would be really useful in this case.
Thanks,
Andrea