Access your configuration file's parsed settings from your tests
This pytest plugin was generated with Cookiecutter along with @hackebrot's cookiecutter-pytest-plugin template.
- Access the sections of your .ini file.
- plaster_pastedeploy
- pytest >= 5.3.5
You can install "pytest-settings" via pip from PyPI:
$ pip install pytest-settings
Import the settings and you are good to go, each key matches a configuration section:
from pytest_settings import settings
Then you can access the sections like this:
my_section = settings['mysection']
And each value in the section:
my_value = settings['mysection']['myvalue']
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the BSD-3 license, "pytest-settings" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.