Base configurations and utilities for developing your Python project test suite with pytest.
pip install git+git://github.com/buzzfeed/pytest_config.git@<version>#egg=pytest_config==<version>
This will install:
pytest_config takes care of the sys.path known issue between pytest and pytest-django by automatically adding the current working directory to the PYTHONPATH before tests run.
$ pytest_config.init [options]
This command will copy all the configuration files needed to easily configure py.test and coverage. Beware of this command as it 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.
The two previous commands share a few of their interface, which is as follows:
pytest_config.update has additional options, though:
pytest_config automatically 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.py
and 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'
The following command line arguments have been added to
py.test to integrate it
smoothly with Caliendo:
caliendoin your tests.