Package: pytest-config
pytest-configBase configurations and utilities for developing your Python project test suite.Installationpip install git+git://github.com/buzzfeed/pytest_config.git@<version>#egg=pytest_config==<version>This will install:pytest_configpy.testplugina simple django app that extends thedjango-admin.pystartapp(under development).apytest_config.initcommand to initialize new config filesapytest_config.updatecommand to interactively update your config files
against the lates default values.FeaturesAutomatic fix for the sys.path known issue.pytest_configtakes care of thesys.pathknownissuebetween pytest and pytest-django
by automatically adding the current working directory to thePYTHONPATHbefore tests run.Management of configuration files$ pytest_config.init [options]This command will copy all the configuration files needed to easily configurepy.testandcoverage. Beware of this command asit will simply replace any
existing config files in you current directory.$ pytest_config.update [options]This command will read the default configuration files and your customized
configuration files. If any of the options in you custom configuration differs
from the defaults, you will be prompted if you want to keep the current one.
If you decline, the default will be saved to your local configuration.Available optionsThe two previous commands share a few of their interface, which is as follows:pytest_config.[init|update]-hprints the help page.pytest_config.[init|update]--coveragemakes the command apply its operations
only for the.coveragercfile.pytest_config.[init|update]--pytest-inimakes the command apply its operationsonly for thepytest.inifile.pytest_config.updatehas additional options, though:pytest_config.update-ysilences the process so that you are not prompted
about anything. All the defaults will be automatically applied if you use this.Automatic test markingpytest_configautomatically marks your tests at runtime with markers based on
what directories the tests are in, so under this architecture:project_root/
    app_name/
    tests/  # root `tests` directory
        ├── __init__.py
        └── app_name/
            ├── __init__.py
            ├── integration/
            │   ├── __init__.py
            │   └── test_foo.py
            └── unit/
                ├── __init__.py
                └── test_bar.pytest functions/methods insideapp_name/unit/*.pywill be marked with@pytest.mark.<app_name>and@pytest.mark.unittest functions/methods insideapp_name/integration/*.pywill be marked with@pytest.mark.<app_name>and@pytest.mark.integrationand so on. This will allow you to run tests on a per-app and per-type basis by running:$ py.test -m unit
$ py.test -m integration
$ py.test -m app_name
$ py.test -m 'app_name and <type>'
$ py.test -m '<type> and app_name'Integration with CaliendoThe following command line arguments have been added topy.testto integrate it
smoothly withCaliendo:py.test--caliendo: Enable the overall use ofcaliendoin your tests.py.test--caliendo-prefixpath/to/caliendo/files: Set the path to where the caliendo
files should live. If you are defining this yourself, it’s recommended that you set it as a path
relative to your current working directory, i.e.caliendo,./caliendo,whatever/caliendoand not as an absolute path. Defaults to$PWD/caliendo.py.test--caliendo--caliendo-purge: Set theCALIENDO_PURGEenvironment variable so that
caliendo can get rid of unused cache, evs, etc.py.test--caliendo--caliendo-prompt: Set theCALIENDO_PROMPTenvironment variable
so that you may use the interactivepromptbuilt in caliendo