Services plugin for pytest testing framework
Project description
Services plugin for pytest testing framework
Install pytest-services
pip install pytest-services
Features
The plugin provides a set of fixtures and utility functions to start service processes for your tests with pytest
Fixtures
- run_services
Determines whethere services should be run or not. False by default if not in distributed environment (without pytest-xdist). Can be manually set to True by overriding this fixture in your test config or just by using –run-services command line argument (see below).
- memcached
Start memcached instance.
- memcached_connection
Memcached connection string.
- mysql
Start mysql-server instance.
- mysql_connection
MySQL connection string.
- xvfb
Start xvfb instance.
- xvfb_display
Xvfb display to use for connection.
Command-line options
- –run-services
Force services to be run even if tests are executed in a non-distributed way (without pytest-xdist).
- –xvfb-display
Skip xvfb service to run and use provided display.
Example
test_your_test.py:
import MySQLdb
def test_some_mysql_stuff(mysql):
"""Test using mysql server."""
conn = MySQLdb.connect(user='root')
Contact
If you have questions, bug reports, suggestions, etc. please create an issue on the GitHub project page.
License
This software is licensed under the MIT license
See License file
© 2014 Anatoly Bubenkov, Paylogic International and others.
Changelog
1.0.0
Initial public release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.