Skip to content

Commit d1e57a3

Browse files
committed
clean up tests
1 parent 13bb7b2 commit d1e57a3

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

sentry_sdk/integrations/asyncpg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ def setup_once() -> None:
4040
asyncpg.Connection.execute = _wrap_execute(
4141
asyncpg.Connection.execute,
4242
)
43-
4443
asyncpg.Connection._execute = _wrap_connection_method(
4544
asyncpg.Connection._execute
4645
)

tests/integrations/asyncpg/test_asyncpg.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@
1010
"""
1111

1212
import os
13-
14-
15-
PG_HOST = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_HOST", "localhost")
16-
PG_PORT = int(os.getenv("SENTRY_PYTHON_TEST_POSTGRES_PORT", "5432"))
17-
PG_USER = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_USER", "postgres")
18-
PG_PASSWORD = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_PASSWORD", "sentry")
19-
PG_NAME = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_NAME", "postgres")
20-
2113
import datetime
2214
from contextlib import contextmanager
2315
from unittest import mock
@@ -35,9 +27,16 @@
3527
from tests.conftest import ApproxDict
3628

3729

30+
PG_HOST = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_HOST", "localhost")
31+
PG_PORT = int(os.getenv("SENTRY_PYTHON_TEST_POSTGRES_PORT", "5432"))
32+
PG_USER = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_USER", "postgres")
33+
PG_PASSWORD = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_PASSWORD", "sentry")
34+
PG_NAME = os.getenv("SENTRY_PYTHON_TEST_POSTGRES_NAME", "postgres")
35+
3836
PG_CONNECTION_URI = "postgresql://{}:{}@{}/{}".format(
3937
PG_USER, PG_PASSWORD, PG_HOST, PG_NAME
4038
)
39+
4140
CRUMBS_CONNECT = {
4241
"category": "query",
4342
"data": ApproxDict(
@@ -317,18 +316,16 @@ async def test_cursor_manual(sentry_init, capture_events) -> None:
317316
("Alice", "pw", datetime.date(1990, 12, 25)),
318317
],
319318
)
320-
#
319+
321320
async with conn.transaction():
322321
# Postgres requires non-scrollable cursors to be created
323322
# and used in a transaction.
324323
cur = await conn.cursor(
325324
"SELECT * FROM users WHERE dob > $1", datetime.date(1970, 1, 1)
326325
)
327-
record = await cur.fetchrow()
328-
print(record)
326+
await cur.fetchrow()
329327
while await cur.forward(1):
330-
record = await cur.fetchrow()
331-
print(record)
328+
await cur.fetchrow()
332329

333330
await conn.close()
334331

@@ -388,8 +385,8 @@ async def test_prepared_stmt(sentry_init, capture_events) -> None:
388385

389386
stmt = await conn.prepare("SELECT * FROM users WHERE name = $1")
390387

391-
print(await stmt.fetchval("Bob"))
392-
print(await stmt.fetchval("Alice"))
388+
await stmt.fetchval("Bob")
389+
await stmt.fetchval("Alice")
393390

394391
await conn.close()
395392

0 commit comments

Comments
 (0)