Skip to main content

Services plugin for pytest testing framework

Project description

Services plugin for pytest testing framework

https://api.travis-ci.org/pytest-dev/pytest-services.png https://pypip.in/v/pytest-services/badge.png https://coveralls.io/repos/pytest-dev/pytest-services/badge.png?branch=master Documentation Status

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-services-1.0.0.tar.gz (12.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page