Skip to content

Commit 9bb8b0a

Browse files
committed
Revert TIME return datetime.time object. (#37)
1 parent 295fff2 commit 9bb8b0a

File tree

8 files changed

+214
-199
lines changed

8 files changed

+214
-199
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## 0.2
44

5+
### 0.2.5
6+
7+
- Revert `TIME` return `datetime.time` object. (#37)
8+
59
### 0.2.4
610

711
- Fix `escape_string` for enum type. (#30)

asyncmy/converters.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ cdef dict decoders = {
313313
YEAR: int,
314314
TIMESTAMP: convert_datetime,
315315
DATETIME: convert_datetime,
316-
TIME: convert_time,
316+
TIME: convert_timedelta,
317317
DATE: convert_date,
318318
BLOB: through,
319319
TINY_BLOB: through,

asyncmy/replication/binlogstream.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ReportSlave:
3939
def __init__(self, value: Union[str, tuple, dict]):
4040
self._hostname = ""
4141
self._username = ""
42-
self._password = ""
42+
self._password = "" # nosec: B105
4343
self._port = 0
4444
if isinstance(value, (tuple, list)):
4545
try:

asyncmy/replication/row_events.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _read_column_data(self, cols_bitmap):
197197
# are enabled
198198
bit_mask = self.packet.read_uint_by_size(column.size)
199199
values[name] = (
200-
set(val for idx, val in enumerate(column.set_values) if bit_mask & 2 ** idx)
200+
set(val for idx, val in enumerate(column.set_values) if bit_mask & 2**idx)
201201
or None
202202
)
203203

conftest.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
import os
33

4-
import pytest
4+
import pytest_asyncio
55

66
import asyncmy
77
from asyncmy import connect
@@ -16,7 +16,7 @@
1616
)
1717

1818

19-
@pytest.fixture(scope="session")
19+
@pytest_asyncio.fixture(scope="session")
2020
def event_loop():
2121
policy = asyncio.get_event_loop_policy()
2222
res = policy.new_event_loop()
@@ -29,14 +29,14 @@ def event_loop():
2929
res._close()
3030

3131

32-
@pytest.fixture(scope="session")
32+
@pytest_asyncio.fixture(scope="session")
3333
async def connection():
3434
conn = await connect(**connection_kwargs)
3535
yield conn
3636
await conn.ensure_closed()
3737

3838

39-
@pytest.fixture(scope="session", autouse=True)
39+
@pytest_asyncio.fixture(scope="session", autouse=True)
4040
async def initialize_tests(connection):
4141
async with connection.cursor(cursor=DictCursor) as cursor:
4242
await cursor.execute("create database if not exists test")
@@ -56,13 +56,13 @@ async def initialize_tests(connection):
5656
)
5757

5858

59-
@pytest.fixture(scope="function", autouse=True)
59+
@pytest_asyncio.fixture(scope="function", autouse=True)
6060
async def truncate_table(connection):
6161
async with connection.cursor(cursor=DictCursor) as cursor:
6262
await cursor.execute("truncate table test.asyncmy")
6363

6464

65-
@pytest.fixture(scope="session")
65+
@pytest_asyncio.fixture(scope="session")
6666
async def pool():
6767
pool = await asyncmy.create_pool(**connection_kwargs)
6868
yield pool

0 commit comments

Comments
 (0)