aio-libs / aiohttp-sse

Server-sent events support for aiohttp
Other
197 stars 36 forks source link

Replaced deprecated `loop` call #428

Closed Olegt0rr closed 8 months ago

Olegt0rr commented 8 months ago

What do these changes do?

Removes deprecated loop property call

Are there changes in behavior for the user?

No

Related issue number

Closes #427

Checklist

Dreamsorcerer commented 8 months ago

Thanks, seems like a couple of other parts could be cleaned up too. I suspect all the loop references may be able to be removed:

examples/chat.py:112:loop = asyncio.get_event_loop()
examples/graceful_shutdown.py:51:    app["worker"] = app.loop.create_task(worker(app))
tests/conftest.py:13:def loop(event_loop, debug):
tests/conftest.py:14:    event_loop.set_debug(debug)
tests/conftest.py:15:    return event_loop
tests/conftest.py:19:def session(loop):
tests/conftest.py:20:    async def create_session(loop):
tests/conftest.py:23:    session = loop.run_until_complete(create_session(loop))
tests/conftest.py:25:    loop.run_until_complete(session.close())
tests/test_sse.py:24:async def test_func(loop, unused_tcp_port, with_sse_response, session):
tests/test_sse.py:80:async def test_wait_stop_streaming(loop, unused_tcp_port, session):
tests/test_sse.py:116:async def test_retry(loop, unused_tcp_port, session):
tests/test_sse.py:163:def test_ping_property(loop):
tests/test_sse.py:179:async def test_ping(loop, unused_tcp_port, session):
tests/test_sse.py:215:async def test_context_manager(loop, unused_tcp_port, session):
tests/test_sse.py:271:async def test_custom_sep(loop, unused_tcp_port, session, sep):
tests/test_sse.py:361:async def test_multiline_data(loop, unused_tcp_port, session, stream_sep, line_sep):
Olegt0rr commented 8 months ago

@Dreamsorcerer , removed all, except loop debug-mode fixture

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (cfdde40) 99.53% compared to head (073b810) 99.52%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #428 +/- ## ========================================== - Coverage 99.53% 99.52% -0.01% ========================================== Files 4 4 Lines 427 424 -3 Branches 45 46 +1 ========================================== - Hits 425 422 -3 Misses 1 1 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.