Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaziamov committed Jan 8, 2025
1 parent 65e227b commit 5fb95f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/test_asyncpg/test_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def database_url():
return os.getenv("TEST_DATABASE_URL")

@pytest.fixture(autouse=True)
def table():
with psycopg2.connect(os.getenv("TEST_DATABASE_URL")) as pg_conn:
def table_for_test(database_url):
with psycopg2.connect(database_url) as pg_conn:
cur = pg_conn.cursor()
table = "test_table"
cur.execute(f"CREATE TABLE {table} (id SERIAL PRIMARY KEY, name TEXT, age INT)")
Expand All @@ -28,7 +28,7 @@ def table():


@pytest.mark.asyncio
async def test_insert_to_table(database_url):
async def test_insert_to_table(table_for_test, database_url):
data = {"name": "test", "age": 20}
table = "test_table"
conn = await connect(dsn=database_url)
Expand Down
6 changes: 0 additions & 6 deletions tests/test_postgres_scheme.sql

This file was deleted.

0 comments on commit 5fb95f7

Please sign in to comment.