@@ -341,7 +341,7 @@ def cb(sock):
341341 self .loop .remove_writer (object ())
342342
343343 def test_selector_thread (self ):
344- assert self .loop ._selector_thread is None
344+ self .assertIsNone ( self . loop ._selector_thread )
345345 a , b = socket .socketpair ()
346346
347347 async def _test ():
@@ -358,21 +358,21 @@ def read():
358358
359359 self .loop .add_reader (b , read )
360360 _selector_thread = self .loop ._selector_thread
361- assert b .fileno () in _selector_thread ._readers
362- assert _selector_thread is not None
361+ self . assertIn ( b .fileno (), _selector_thread ._readers )
362+ self . assertIsNotNone ( _selector_thread )
363363 self .loop .add_writer (a , write )
364- assert self .loop ._selector_thread is _selector_thread
365- assert a .fileno () in _selector_thread ._writers
364+ self .assertIs ( self . loop ._selector_thread , _selector_thread )
365+ self . assertIn ( a .fileno (), _selector_thread ._writers )
366366 msg = await asyncio .wait_for (read_future , timeout = 10 )
367367
368368 self .loop .remove_writer (a )
369- assert a .fileno () not in _selector_thread ._writers
369+ self . assertNotIn ( a .fileno (), _selector_thread ._writers )
370370 self .loop .remove_reader (b )
371- assert b .fileno () not in _selector_thread ._readers
371+ self . assertNotIn ( b .fileno (), _selector_thread ._readers )
372372 a .close ()
373373 b .close ()
374- assert self .loop ._selector_thread is _selector_thread
375- assert msg == sent
374+ self .assertIs ( self . loop ._selector_thread , _selector_thread )
375+ self . assertEqual ( msg , sent )
376376
377377 self .loop .run_until_complete (_test ())
378378
0 commit comments