Skip to main content

dbfixtures plugin for py.test.

Project description

redis, mongo, rabbitmq py.test fixutres

Install

python setup.py install

How to use

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

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

def test_using_rabbit(rabbitmq):
    channel = 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.

Examples:

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.

Source Distribution

pytest-dbfixtures-0.0.1.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file pytest-dbfixtures-0.0.1.tar.gz.

File metadata

File hashes

Hashes for pytest-dbfixtures-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e2581cc471d7e1f01ae02a5b8edce90458cc90f7019e90e5a229e0117871f14d
MD5 38dea82dd748d790967d76271ba49a9a
BLAKE2b-256 eb59e006b5bc1e533eb9d8269cf52cc0d5fe7b50642c236818996e9f585265e5

See more details on using hashes here.

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