Skip to content

kvaldivia/pytest-settings

Repository files navigation

pytest-settings

PyPI version Python versions See Build Status on Travis CI See Build Status on AppVeyor

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.

Features

  • Access the sections of your .ini file.

Requirements

  • plaster_pastedeploy
  • pytest >= 5.3.5

Installation

You can install "pytest-settings" via pip from PyPI:

$ pip install pytest-settings

Usage

  • 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']
    

Contributing

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.

License

Distributed under the terms of the BSD-3 license, "pytest-settings" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

About

Access the .ini configuration from your tests in pytest :D

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages