Skip to main content

Databases fixtures plugin for py.test.

Project description

pytest-dbfixtures

Latest PyPI version Documentation Status Number of PyPI downloads Wheel Status Egg Status License

Package status

Tests Coverage Status Requirements Status

Overview

py.test clean fixtures for: postgresql, mysql, redis, mongo, elasticsearch and rabbitmq.

Starts specific database deamon and cleanup all data produced during tests.

Install

$ pip install --upgrade pytest-dbfixtures

How to use

Please see documentation

CHANGES

0.13.0

  • [feature] make it easier to support future postgresql out of the box

  • [feature] support for postgresql 9.5

  • [docs] add contribute guidelines

  • [feature] add info about minimal version supported - closes #132

  • [enhancements] - moved source code into src folder

  • [feature] python3.5 compatibility

  • [docs] enhance docs - refs #126

  • [feature] PGsql connection error on FreeBSD jailed environments

    In FreeBSD jailed environments the loopback interface can not be used to connect to pgsql, because it points to the loopback interface of the host and not the jail.

    Thus, it seems to pgsql like the connection is comming from the ip address assigned to the jail.

    This ensures that pgsql can be connected to from any host, when run on a FreeBSD systems. This this package can be used in FreeBSD jailed environments

  • [feature] Use log destination param for pgsql

    This commit ensures that stderr is used for logging, by specifying the command line parameter.

    On FreeBSD this is very important otherwise syslog will be used and the db-fixtures will hang as it looks in the expected log file and loops forever waiting for a “database is ready” entry to appear… log_destination=stderr is default on most systems and can be set in postgresql.conf or given as an command line argument.

    Read more

0.12.0

  • [bugfix] mongodb fixture no longer removes any of system.* collections

  • [bugfix] configured pytest-dbfixtures to work with pymlconf versions compatible with Python 3

0.11.0

  • make pytest-dbfixtures compatible with mirakuru 0.5.0

0.10.0

  • fix W503 pep8 errors, that appeared after new pylama got released

  • update to be able to use pytest-dbfixtures with pymongo 3

  • ability to properly use also beta versions of postgresql releases. (previously only stable versions were targeted)

0.9.0

  • add ability to set custom location for logs (might be useful for analysing logs from tests)

  • added postgresql 9.4 to supported versions.

0.8.2

  • Use port number in default RabbitMQ node name.

    This allows using just the port=’?’ argument to rabbitmq_proc to run multiple independent RabbitMQ instances for use with xdist to parallelize tests on a single machine.

  • Old versions of Redis notification

    displays a message about old version of redis

0.8.1

  • Feature: random ports selection Adds a possibility of passing ‘?’ in port= argument of process fixtures.

  • Removes ‘port’ from db fixtures

  • Fixes postgres missing host - previously using config.postgresql.unixsocketdir

0.7.0

  • redisdb fixture allows to specify client connection class

  • redisdb fixture uses now StrictRedis by default (backward incompatible)

0.6.0

  • replaced MySQLdb with it’s fork mysqlclient - compatibility with python3

  • renamed mysqldb fixture to mysql to keep it consistent with other client fixtures.

  • replaced pika with python 3 compatible rabbitpy

  • removed deprecated mysqldb_session/mysql_session

  • bugfix of rabbitmq fixture: cast rabbitmq queues and exchanges to str due to pamq having problems

  • internal changes: removed GentleKillingExecutor as mirakuru already implements same functionality

0.5.2

  • syntax fixes for python 3

  • moved postgresql starting code into it’s own executor

  • xdist distributed hosts testing bugfix (but xdist parallelization on one host won’t work)

0.5.1

  • make rabbitmq logs persistent

0.5.0

  • update mirakuru to min 0.2

  • os.killpg to terminate process

  • add tests coverage on coveralls

0.4.22

  • remove creating old RABBITMQ env variables

0.4.21

  • remove elasticsearch home folder at process teardown

  • set elasticsearch index.store.type to memory by default

  • localized elasticsearch instance by default

  • replaced summon_process with mirakuru

0.4.20

  • RabbitMQ process fixture is session scoped

  • rabbitmq fixture factory accepts custom teardown

0.4.19

  • StopRunningExecutor to simply return if process had been already killed.

0.4.18

  • MongoDB fixtures can be now initialized by factories

0.4.17

  • Bugfix: params in redis fixture

0.4.16

  • Add params to mysql fixture

0.4.15

  • Client fixtures now check if process (process fixture) is running before every test and starts process if it was terminated after previous test.

0.4.14

  • Bugfix: Now we don’t overwrite postgresql config in postgres_proc

0.4.13

  • Bugfix of rabbitmq_proc fixture - now it works with scope=function

0.4.12

  • Overrides SimpleExecutor’s behavior with a try of more gentle terminating subprocess before killing it.

  • Deprecate scope for mysqldb fixture and change it to function by default.

  • RabbitMQ factories support (multiple rabbit fixtures).

0.4.10

  • Postgresql multiple versions proper support

  • Default timeouts and waits for process executors

0.4.8

  • introduced Elasticsearch fixture

0.4.6

  • mysql fixture now uses factories

0.4.4

  • postgresql fixtures and fixture factories

  • small code quality improvements

  • pylama code check

0.4.3

  • splits rabbitmq fixture into process/client fixtures

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.13.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

pytest_dbfixtures-0.13.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pytest-dbfixtures-0.13.0.tar.gz
Algorithm Hash digest
SHA256 a252caf7d14a8c5231b7a1994f1dbd42e403be8a47769a0d8a94840087e95e59
MD5 e7e7d1d7d10c37626fb8085557372a8a
BLAKE2b-256 d7c17d35dd9ee81d065d973812ef80653060c3bd2349a3679741347ab4d02df8

See more details on using hashes here.

File details

Details for the file pytest_dbfixtures-0.13.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_dbfixtures-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0e7bf0f50d74ac8e26c158e72f43073ac36bad2f30a06d39b9e4f40537ebddd
MD5 8e057194765420281a296d1480a6af2c
BLAKE2b-256 6ce696298db9320e3a8e7c8f0aedda0718f9c56cf779e18df0bc86554e27a039

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