Skip to main content

dbfixtures plugin for py.test.

Project description

py.test fixtures: redis, mongo, rabbitmq


$ pip install pytest-dbfixtures

How to use

def test_using_redis(redisdb):
    redisdb.set('woof', 'woof')

def test_using_mongo(mongodb):
    mongodb.test.insert({'woof': 'woof'})

def test_using_rabbit(rabbitmq):
    channel =

Use your own configure files

Of course you can! Below you can see example configs.

  • pytest_dbfixtures/dbfixtures.conf
  • pytest_dbfixtures/redis.conf
  • pytest_dbfixtures/mongo.conf
  • pytest_dbfixtures/rabbit.conf

If you want to use your own configs pass them as arguments to py.test.


py.test --dbfixtures-config my-dbfixtures.conf

py.test --dbfixtures-config my-dbfixtures.conf --mongo-config my-mongo.conf

py.test --redis-config my-redis.conf
py.test --rabbit-config my-rabbit.conf

Project details

Download files

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

Files for pytest-dbfixtures, version 0.3.5
Filename, size File type Python version Upload date Hashes
Filename, size pytest-dbfixtures-0.3.5.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page