dbfixtures plugin for py.test.
Project description
py.test fixtures: redis, mongo, rabbitmq
Install
$ pip install pytest-dbfixtures
How to use
def test_using_redis(redisdb):
redisdb.set('woof', 'woof')
redisdb.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
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.
Source Distribution
File details
Details for the file pytest-dbfixtures-0.3.6.5.tar.gz
.
File metadata
- Download URL: pytest-dbfixtures-0.3.6.5.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 013bddf0a470cfca6c9f4813dca59da9f5e5fb16fdb979e5a58fae5c4e44c93e |
|
MD5 | 94ea4de2963b15c047fbd8c258d5118c |
|
BLAKE2b-256 | 29e5356cfe214bd8a0bcf5c35e34dfd2d047f1318a98140e3677d372d83e1693 |