Fix broken test in Python 3.7 (#25067)

pull/25062/head^2
Paulus Schoutsen 2019-07-10 12:17:10 -07:00 committed by GitHub
parent 777e1ca832
commit 7d33b0a259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -21,7 +21,7 @@ def test_sensitive_data_filter():
@asyncio.coroutine @asyncio.coroutine
def test_async_handler_loop_log(loop): def test_async_handler_loop_log(loop):
"""Test the logging sensitive data filter.""" """Test logging data inside from inside the event loop."""
loop._thread_ident = threading.get_ident() loop._thread_ident = threading.get_ident()
queue = asyncio.Queue(loop=loop) queue = asyncio.Queue(loop=loop)
@ -40,13 +40,13 @@ def test_async_handler_loop_log(loop):
log_record = logging.makeLogRecord({'msg': "Test Log Record"}) log_record = logging.makeLogRecord({'msg': "Test Log Record"})
handler.emit(log_record) handler.emit(log_record)
yield from handler.async_close(True) yield from handler.async_close(True)
assert queue.get_nowait() == log_record assert queue.get_nowait().msg == "Test Log Record"
assert queue.empty() assert queue.empty()
@asyncio.coroutine @asyncio.coroutine
def test_async_handler_thread_log(loop): def test_async_handler_thread_log(loop):
"""Test the logging sensitive data filter.""" """Test logging data from a thread."""
loop._thread_ident = threading.get_ident() loop._thread_ident = threading.get_ident()
queue = asyncio.Queue(loop=loop) queue = asyncio.Queue(loop=loop)
@ -63,7 +63,7 @@ def test_async_handler_thread_log(loop):
yield from loop.run_in_executor(None, add_log) yield from loop.run_in_executor(None, add_log)
yield from handler.async_close(True) yield from handler.async_close(True)
assert queue.get_nowait() == log_record assert queue.get_nowait().msg == "Test Log Record"
assert queue.empty() assert queue.empty()