Skip to content

Commit 990496a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ea71a07 commit 990496a

3 files changed

Lines changed: 5 additions & 13 deletions

File tree

pytest_postgresql/factories/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ def postgresql_async(
112112
"""
113113
if pytest_asyncio is None:
114114
raise ImportError(
115-
"pytest-asyncio is required for async fixtures. "
116-
"Install it with: pip install pytest-postgresql[async]"
115+
"pytest-asyncio is required for async fixtures. Install it with: pip install pytest-postgresql[async]"
117116
)
118117

119118
@pytest_asyncio.fixture(scope=scope)

pytest_postgresql/loader.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ async def sql_async(sql_filename: Path, **kwargs: Any) -> None:
6060
"""
6161
if aiofiles is None:
6262
raise ImportError(
63-
"aiofiles is required for async SQL loading. "
64-
"Install it with: pip install pytest-postgresql[async]"
63+
"aiofiles is required for async SQL loading. Install it with: pip install pytest-postgresql[async]"
6564
)
6665

6766
async with await psycopg.AsyncConnection.connect(**kwargs) as db_connection:

tests/test_janitor.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ async def test_async_janitor_init_with_template() -> None:
194194
async def test_async_janitor_init_as_template() -> None:
195195
"""init() appends IS_TEMPLATE = true when as_template is True."""
196196
cur = _make_cursor_mock()
197-
janitor = AsyncDatabaseJanitor(
198-
user="user", host="host", port="1234", dbname="mydb", as_template=True, version=10
199-
)
197+
janitor = AsyncDatabaseJanitor(user="user", host="host", port="1234", dbname="mydb", as_template=True, version=10)
200198
with patch.object(AsyncDatabaseJanitor, "cursor", _make_cursor_context(cur)):
201199
await janitor.init()
202200

@@ -220,9 +218,7 @@ async def test_async_janitor_drop_drops_database() -> None:
220218
async def test_async_janitor_drop_as_template() -> None:
221219
"""drop() resets is_template before dropping when as_template is True."""
222220
cur = _make_cursor_mock()
223-
janitor = AsyncDatabaseJanitor(
224-
user="user", host="host", port="1234", dbname="mydb", as_template=True, version=10
225-
)
221+
janitor = AsyncDatabaseJanitor(user="user", host="host", port="1234", dbname="mydb", as_template=True, version=10)
226222
with patch.object(AsyncDatabaseJanitor, "cursor", _make_cursor_context(cur)):
227223
await janitor.drop()
228224

@@ -243,9 +239,7 @@ def test_async_janitor_is_template_false() -> None:
243239

244240
def test_async_janitor_is_template_true() -> None:
245241
"""is_template() returns True when as_template=True."""
246-
janitor = AsyncDatabaseJanitor(
247-
user="user", host="host", port="1234", dbname="mydb", as_template=True, version=10
248-
)
242+
janitor = AsyncDatabaseJanitor(user="user", host="host", port="1234", dbname="mydb", as_template=True, version=10)
249243
assert janitor.is_template() is True
250244

251245

0 commit comments

Comments
 (0)