Skip to content
This repository has been archived by the owner on Sep 18, 2018. It is now read-only.

Markovianhq fix/postgres fixture #187

Merged
merged 6 commits into from
Sep 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pytest-dbfixtures along it's history.
* Dwayne Litzenberger
* Karolina Blümke
* Michał Masłowski
* Georg Walther

Great thanks to `Clearcode <http://clearcode.cc>`_ for allowing releasing
pytest-dbfixtures as free software!
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGES
unreleased
------

- [enhancements] - use semicolon to terminate postgresql CREATE/DROP DATABASE statements
- [bugfix] - removed unneded dependency
- [enhancement] - split out elasticsearch fixtures into separate package. See `pytest-elasticsearch <https://pypi.python.org/pypi/pytest-elasticsearch/>`_
- [feature] use tmpfile.gettempdir instead of hardcoded /tmp directory
Expand Down
6 changes: 3 additions & 3 deletions src/pytest_dbfixtures/factories/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def init_postgresql_database(psycopg2, user, host, port, db):
conn = psycopg2.connect(user=user, host=host, port=port)
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cur = conn.cursor()
cur.execute('CREATE DATABASE ' + db)
cur.execute('CREATE DATABASE {0};'.format(db))
cur.close()
conn.close()

Expand All @@ -121,7 +121,7 @@ def drop_postgresql_database(psycopg2, user, host, port, db):
conn = psycopg2.connect(user=user, host=host, port=port)
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cur = conn.cursor()
cur.execute('DROP DATABASE IF EXISTS %s' % db)
cur.execute('DROP DATABASE IF EXISTS {0};'.format(db))
cur.close()
conn.close()

Expand Down Expand Up @@ -215,7 +215,7 @@ def postgresql(process_fixture_name, db=None):
postgresql database factory.

:param str process_fixture_name: name of the process fixture
:param int db: database name
:param str db: database name
:rtype: func
:returns: function which makes a connection to postgresql
"""
Expand Down