Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
devel:kubic:ei-demo
python-aioredis
fix_tests.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix_tests.patch of Package python-aioredis
diff --git a/tests/connection_test.py b/tests/connection_test.py index 40c69d6..40b3a68 100644 --- a/tests/connection_test.py +++ b/tests/connection_test.py @@ -59,7 +59,9 @@ async def test_connect_inject_connection_cls_invalid( async def test_connect_tcp_timeout(request, create_connection, server): with patch('aioredis.connection.open_connection') as open_conn_mock: - open_conn_mock.side_effect = lambda *a, **kw: asyncio.sleep(0.2) + async def __side_effect(*a, **kw): + return await asyncio.sleep(0.2) + open_conn_mock.side_effect = __side_effect with pytest.raises(asyncio.TimeoutError): await create_connection(server.tcp_address, timeout=0.1) @@ -84,7 +86,9 @@ async def test_connect_unixsocket(create_connection, server): reason="No unixsocket on Windows") async def test_connect_unixsocket_timeout(create_connection, server): with patch('aioredis.connection.open_unix_connection') as open_conn_mock: - open_conn_mock.side_effect = lambda *a, **kw: asyncio.sleep(0.2) + async def __side_effect(*a, **kw): + return await asyncio.sleep(0.2) + open_conn_mock.side_effect = __side_effect with pytest.raises(asyncio.TimeoutError): await create_connection(server.unixsocket, db=0, timeout=0.1) diff --git a/tests/pool_test.py b/tests/pool_test.py index b5693f5..dbc6ffb 100644 --- a/tests/pool_test.py +++ b/tests/pool_test.py @@ -15,7 +15,7 @@ from aioredis import ( ) from _testutils import redis_version -BPO_34638 = sys.version_info >= (3, 8) +BPO_34638 = False # sys.version_info >= (3, 8) def _assert_defaults(pool): @@ -59,7 +59,9 @@ async def test_maxsize(maxsize, create_pool, server): async def test_create_connection_timeout(create_pool, server): with patch('aioredis.connection.open_connection') as\ open_conn_mock: - open_conn_mock.side_effect = lambda *a, **kw: asyncio.sleep(0.2) + async def __side_effect(*a, **kw): + return await asyncio.sleep(0.2) + open_conn_mock.side_effect = __side_effect with pytest.raises(asyncio.TimeoutError): await create_pool( server.tcp_address,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor