Skip to content

Upgrading pytest-postgresql 4 to 5

Breaking4.1.1 → 5.1.1Breaking3Platform1New1Changed2Fixed3Other17

BreakingUpgrade verdict

3 breaking changes and a platform requirement change.

  • This version no longer works on Python 3.7; you need a newer Python.
  • The log prefix setting is gone because fixture data is already separated by its temporary directory.
  • You must now install psycopg (version 3) to use this package; the old optional psycopg2 variants are gone.
  • The package can now be used with Python 3.12.
4 items need code or config changes

Python requirement changed in 5.0.0: >=3.7 → >=3.8.

Adds psycopg >=3.0.0.

Installs 10 packages in all (was 9).

Breaking3
Drops support for Python 3.7.
Removes the --postgresql-logsprefix and postgresql_logsprefix options.
--postgresql-logsprefixpostgresql_logsprefix
Makes psycopg a mandatory requirement instead of an optional psycopg2 dependency.
psycopgpsycopg2psycopg2-binarypsycopg2cffi
Platform1
Adds support for Python 3.12.

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • removed: export connection
  • removed: export cursor
  • removed: export psycopg
  • removed: function check_for_psycopg() -> None
  • removed: variable connection
  • removed: variable cursor
  • removed: variable psycopg
  • changed: function get_config(request: FixtureRequest) -> dict → function get_config(request: FixtureRequest) -> PostgresqlConfigDict
  • added: class PostgresqlConfigDict(TypedDict)
  • added: field PostgresqlConfigDict.dbname: str
  • added: field PostgresqlConfigDict.exec: str
  • added: field PostgresqlConfigDict.host: str
  • added: field PostgresqlConfigDict.load: List[str]
  • added: field PostgresqlConfigDict.options: str
  • added: field PostgresqlConfigDict.password: str
  • added: field PostgresqlConfigDict.port: Optional[str]
  • added: field PostgresqlConfigDict.postgres_options: str
  • added: field PostgresqlConfigDict.startparams: str
  • added: field PostgresqlConfigDict.unixsocketdir: str
  • added: field PostgresqlConfigDict.user: str
  • added: class ExecutableMissingException(FileNotFoundError)
  • added: class PostgreSQLUnsupported(Exception)
  • removed: class PostgreSQLUnsupported(Exception)
  • changed: function postgresql(process_fixture_name: str, dbname: Optional[str]=…, load: Optional[List[Union[Callable, str]]]=…, isolation_level: Optional[psycopg.IsolationLevel]=…) -> Callable[[FixtureRequest], Iterator[connection]] → function postgresql(process_fixture_name: str, dbname: Optional[str]=…, load: Optional[List[Union[Callable, str]]]=…, isolation_level: Optional[psycopg.IsolationLevel]=…) -> Callable[[FixtureRequest], Iterator[Connection]]
  • changed: method DatabaseJanitor.cursor() -> Iterator[cursor] → method DatabaseJanitor.cursor() -> Iterator[Cursor]