- Set minimum version of port-for dependecy in pyproject.toml for client installations. (#1015)
- add support for \ character in pytest temporary path (#982)
- Add test for PR #965
- refactors test_executor.py to enable Mac
- Fixed a long-standing bug, where calls to pg_ctl weren't getting LC_* and LANG envvars, which caused issues on some systems not recognizing --auth parameter. (#343)
- DatabaseJanitor class now accepts only keyword arguments. (#899)
- Fix the remaining DepcrecationWarning for datetime.datetime.utcnow on Python 3.12. (#896)
- Deprecated load parameter on a client fixture. Developers are encouraged to either use the load function/parameter for process fixture, or create an intermediate fixture placed between client and tests themselves to fill in the data. (#850)
Now all sql files used to initialise database for tests, has to be passed as pathlib.Path instance.
This helps the DatabaseJanitor choose correct behaviour based on parameter. (#638)
Have separate parameters for template database name and database name in DatabaseJanitor. It'll make it much clearer to understand the code and Janitor's behaviour. (#672)
Template databases are now created with is_template flag turned on, and not by setting allow_connections to false.
The allow_connections flag being set to false is used strictly right before we attempt to drop the database. (#914)
- Add missing python 3.12 classifier to pythin package. (#915)
- Update postgresql_load default value for it to fallback into the empty list (#881)
- Support for Python 3.12 (#835)
- Removed misleading parapgraph from one example in a README (#688)
- Fixed typing exceptions for mypy 1.4 (#765)
- README: fix section markup (#771, #776)
- Add SQLAlchemy example for initialising common database state. (#797)
- Rely on cached/artifacted Pipfile.lock. That way, it will be specifically defined for given python version/system. (#834)
- CI Change - Add PostgreSQL 16, drop PostgreSQL 11 (#836)
- Replace usage of pkg_resources.parse_version with packaging.version.parse (#858)
Drop support for Python 3.7 (#706)
psycopg is now a mandatory requirement. With pyscop2 it was optional due to the different ways it could be installed:
- psycopg2 - that built itself
- psycopg2-binary - binary distribution
- psycopg2cffi - pypy enabled version
Since psycopg version 3 there's only one package to install. (#744)
Dropped --postgresql-logsprefix/postgresql_logsprefix options. All fixture data is already distinguished by tmpdir itself. (#748)
- Drop PyPy from CI (#669)
- pytest-postgresql will now recognise and use development postgresql versions (#691)
- Use towncrier to maintain project's newsfragments/changelog (#700)
- Move project dependency management to pipenv (#701)
- Migrate to shared automerge workflow for automatic tests dependency updates (#702)
- Use tbump instead of bumpversion to manage versioning and releases. (#703)
- Move most of package configuration to pyproject.toml (#704)
- Introduce Typed config dict (#706)
- Use ankane/setup-postgres@v1 to setup postgresql in CI instead of custom scripts. (#708)
- Pass codecov_token to codecov action to upload coverage. (#721)
- Replaced flake8 and pydocstyle with ruff, turned on isort rules (#735)
- Split single bid test job into smaller running each after another. (#740)
- Error message typo fix
- Docker documentation example typo fixes
- Have setuptools required as package dependency. pkg_resources.parse_version is used in code but setuptools was only used as build requirements
- Import FixtureRequest from pytest, not private _pytest. Require at least pytest 6.2
- Replace tmpdir_factory with tmp_path_factory
- Upgrade to psycopg 3.
- Xdist running test connecting to already existing postgresql, will now create separate databases for each worker.
- Use psycopg 3 and return its connections in client fixtures.
- Drop support for postgresql 9.6
- client fixture will no longer utilize configuration's load param
- client fixture will no longer utilize configuration's dbanme parameter
- Add Postgresql 14 to the CI
- Database can be created by DatabaseJanitor or the client fixture when an isolation level is specified.
- rely on get_port functionality delivered by port_for
- Added type annotations and compatibitlity with PEP 561
- pre-commit configuration
- Changed UPDATE pg_database SET to ALTER. System tables should not be updated.
- Fixed DatabaseJanitor port type hint to int from str
- Changed retry definition to not fail if psycopg2 is not installed. Now the default is Exception.
- Support python 3.7 and up
- Ability to create template database once for the process fixture and re-recreate a clean database out of it every test. Not only it does provide some common db initialisation between tests but also can speed up tests significantly, especially if the initialisation has lots of operations to perform.
- DatabaseJanitor can now define a connection_timeout parameter. How long will it try to connect to database before raising a TimeoutError
- Updated supported python versions
- Unified temporary directory handling in fixture. Settled on tmpdir_factory.
- Fully moved to the Github Actions as CI/CD pipeline
- Deprecated support for logs_prefix process fixture factory argument, --postgresql-logsprefix pytest command line option and postgresql_logsprefix ini configuration option. tmpdir_factory now builds pretty unique temporary directory structure.
- Dropped support for postgresql 9.5 and down
- Removed init_postgresql_database and drop_postgresql_database functions. They were long deprecated and their role perfectly covered by DatabaseJanitor class.
- pytest_postgresql.factories.get_config was moved to pytest_postgresql.config.get_config
- all db_name keywords and attributes were renamed to dbname
- postgresql_nooproc fixture was renamed to postgresql_noproc
- Use postgresql_logsprefix and --postgresql-logsprefix again. They were stopped being used somewhere along the way.
- Sometimes pytest-postrgesql would fail to start postgresql with "FATAL: the database system is starting up" message. It's not really a fatal error, but a message indicating that the process still starts. Now pytest-postgresql will wait properly in this cases.
- [bugfix] To not fail loading code if no postgresql version is installed. Fallback for janitor and process fixture only, if called upon.
- [enhancement] add ability to pass options to pg_ctl's -o flag to send arguments to the underlying postgres executable Use postgres_options as fixture argument, --postgresql-postgres-options as pytest starting option or postgresql_postgres_options as pytest.ini configuration option
- [enhancement] Add ability to set up isolation level for fixture and janitor
- [fix] Status checks for running postgres depend on pg_ctl status code, not on pg_ctl log language. Fixes starting on systems without C locale. Thanks @Martin Meyries.
- [fix] Added LC_* env vars to running initdb and other utilities. Now all tools and server are using same, C locale
- [feature] Ability to define default schema to initialize database with
- [docs] Added more examples to readme on how to use the plugin
- [enhancement] extract NoopExecutor into it's own submodule
- [bugfix] Ignore occasional ProcessFinishedWithError error on executor exit.
- [bugfix] Fixed setting custom password for process fixture
- [bugfix] Fix version detection, to allow for two-digit minor version part
- [feature] Drop support for python 3.5
- [enhancement] require at least mirakuru 2.3.0 (executor's stop method parameter's change)
- [bug] pass password to DatabaseJanitor in client's factory
- [feature] Allow to set password for postgresql. Use it throughout the flow.
- [bugfix] Default Janitor's connections to postgres database. When using custom users, postgres attempts to use user's database and it might not exist.
- [bugfix] NoopExecutor connects to read version by context manager to properly handle cases where it can't connect to the server.
- [bugfix] Fix drop_postgresql_database to actually use DatabaseJanitor.drop instead of an init
- [feature] ability to properly connect to already existing postgresql server using
postgresql_nooproc
fixture.
- [enhancement] Gather helper functions maintaining postgresql database in DatabaseJanitor class.
- [deprecate] Deprecate
init_postgresql_database
in favour ofDatabaseJanitor.init
- [deprecate] Deprecate
drop_postgresql_database
in favour ofDatabaseJanitor.drop
- [feature] Drop support for python 2.7. From now on, only support python 3.5 and up
- [feature] Ability to configure database name through plugin options
- [enhancement] Use tmpdir_factory. Drop
logsdir
parameter - [ehnancement] Support only Postgresql 9.0 and up
- [bugfix] Always start postgresql with LC_ALL, LC_TYPE and LANG set to C.UTF-8. It makes postgresql start in english.
- [bugfix] Allow creating test database with hyphens
- [enhancements] Ability to configure additional options for postgresql process and connection
- [bugfix] - removed hard dependency on
psycopg2
, allowing any of its alternative packages, likepsycopg2-binary
, to be used. - [maintenance] Drop support for python 3.4 and use 3.7 instead
[bugfix] properly detect if executor running and clean after executor is being stopped
Note
Previously if a test failed, there was a possibility of the executor being removed when python was closing, causing it to print ignored errors on already unloaded modules.
- [enhancement] use executor's context manager to start/stop postrgesql server in a fixture
- [bugfix] version regexp to correctly catch postgresql 10
- [enhancement] explicitly turn off logging_collector
- [feature] pypy compatibility
[bugfix] - disallow connection to database before it gets dropped.
Note
Otherwise it caused random test subprocess to connect again and this the drop was unsuccessful which resulted in many more test fails on setup.
[cleanup] - removed path.py dependency
- [bugfix] - Fixing the default pg_ctl path creation
- [feature] - migrate usage of getfuncargvalue to getfixturevalue. require at least pytest 3.0.0
- create command line and pytest.ini configuration options for postgresql starting parameters
- create command line and pytest.ini configuration options for postgresql username
- make the port random by default
- create command line and pytest.ini configuration options for executable
- create command line and pytest.ini configuration options for host
- create command line and pytest.ini configuration options for port
- Extracted code from pytest-postgresql