This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

DevPi server fixture for py.test. The server is session-scoped by default and run in a subprocess and temp dir to cleanup when it’s done.

After the server has started up it will create a single user with a password, and an index for that user. It then activates that index and provides a handle to the devpi-client API so you can manipulate the server in your tests.


Install using your favourite package manager:

pip install pytest-devpi-server
#  or..
easy_install pytest-devpi-server

Enable the fixture explicitly in your tests or (not required when using setuptools entry points):

pytest_plugins = ['pytest_devpi_server']


Here’s a noddy test case showing the main functionality:

def test_devpi_server(devpi_server):
    # This is the client API for the server that's bound directly to the 'devpi' command-line tool.
    # Here we list the available indexes
    print devpi_server.api('use', '-l')

    # Create and use another index
    devpi_server.api('index', '-c', 'myindex')
    devpi_server.api('index', 'use', 'myindex')

    # Upload a package
    import os

    # Get some json data
    import json
    res = devpi_server.api('getjson', '/user/myindex')
    assert json.loads(res)['result']['projects'] == ['my-package-name']

DevpiServer class

Using this with the default devpi_server py.test fixture is good enough for a lot of use-cases however you may wish to have more fine-grained control about the server configuration.

To do this you can use the underlying server class directly - this is an implenentation of the pytest-server-fixture framework and as such acts as a context manager:

import json
from pytest_devpi_server import DevpiServer

def test_custom_server():
    with DevPiServer(
          # You can specify you own initial user and index

          # You can provide a zip file that contains the initial server database,
          # this is useful to pre-load any required packages for a test run
       ) as server:

           assert not server.dead
           res = server.api('getjson', '/bob/myindex')
           assert 'pre-loaded-package' in json.loads(res)['result']['projects']

    # Server should now be dead
    assert server.dead


1.1.0 (2016-2-15)

  • New plugin: devpi server fixture
  • pytest-profiling improvement: overly-long .prof files are saved as the short hash of the test name (Thanks to Vladimir Lagunov for PR)
  • Changed default behavior of to not use a subshell for security reasons
  • Corrected method to handle arguments the same as the parent method
  • Removed deprecated ‘–distribute’ from virtualenv args

1.0.1 (2015-12-23)

  • Packaging bugfix

1.0.0 (2015-12-21)

  • Initial public release
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pytest_devpi_server-1.1.0-py2.7.egg (4.7 kB) Copy SHA256 Checksum SHA256 2.7 Egg Feb 15, 2016
pytest_devpi_server-1.1.0-py2-none-any.whl (7.3 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Feb 15, 2016
pytest-devpi-server-1.1.0.tar.gz (5.9 kB) Copy SHA256 Checksum SHA256 Source Feb 15, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting