Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 17, 2024
1 parent b67b1a0 commit 0b376f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.11
rev: v0.1.13
hooks:
- id: ruff
args: ["--preview", "--fix"]
Expand Down
30 changes: 10 additions & 20 deletions tests/test_async_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,10 @@ async def test_execute_prepared_statement_insert():
"""

async with open_connection() as conn:
await conn.execute(
"""
await conn.execute("""
create temp table test_epsi (
id int primary key generated always as identity, foo text not null
);"""
)
);""")

st_no_params = await conn.create_prepared_statement(
name="test_epsp_1", query="insert into test_epsi(foo) values ('one');"
Expand Down Expand Up @@ -277,14 +275,12 @@ async def test_insert():
"""

async with open_connection() as conn:
await conn.execute(
"""
await conn.execute("""
create temp table test_insert (
id int primary key generated always as identity,
foo text not null
);
"""
)
""")
row_count = await conn.execute("insert into test_insert(foo) values (:one);", one="test")
assert row_count == 1
result = await conn.fetch_one("select * from test_insert;")
Expand All @@ -298,12 +294,10 @@ async def test_unparameterised_insert():
"""

async with open_connection() as conn:
await conn.execute(
"""create temp table test_insert2 (
await conn.execute("""create temp table test_insert2 (
id int primary key generated always as identity,
foo text not null
);"""
)
);""")
row_count = await conn.execute("insert into test_insert2(foo) values ('test');")
assert row_count == 1
result = await conn.fetch_one("select * from test_insert2;")
Expand All @@ -317,13 +311,11 @@ async def test_update():
"""

async with open_connection() as conn:
await conn.execute(
"""
await conn.execute("""
create temp table test_update (
id int primary key generated always as identity, foo text not null
);
"""
)
""")
await conn.execute("insert into test_update(foo) values (:one);", one="test")
pre_update = await conn.fetch_one("select * from test_update;")
assert pre_update
Expand All @@ -342,14 +334,12 @@ async def test_delete():
"""

async with open_connection() as conn:
await conn.execute(
"""
await conn.execute("""
create temp table test_delete (
id int primary key generated always as identity,
foo text not null
);
"""
)
""")
await conn.execute("insert into test_delete(foo) values (:one);", one="test")
pre_delete = await conn.fetch("select * from test_delete;")
assert len(pre_delete) == 1
Expand Down

0 comments on commit 0b376f4

Please sign in to comment.