File tree Expand file tree Collapse file tree 1 file changed +9
-18
lines changed
Expand file tree Collapse file tree 1 file changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -42,24 +42,15 @@ def test_shutdown_gracefully(client_session):
4242
4343
4444class TestServerThreaded ():
45- def test_run_forever (self ):
46- server = WebsocketServer (port = 0 )
47- assert server .thread == None
48-
49- # Run threaded
50- server .run_forever (threaded = True )
51- assert server .thread
52- assert not isinstance (server .thread , threading ._MainThread )
53- assert server .thread .is_alive ()
54-
55- def test_shutdown (self ):
56- server = WebsocketServer (port = 0 )
57- server .run_forever (threaded = True )
58- assert server .thread .is_alive ()
59-
60- # Shutdown de-facto way
61- server .shutdown ()
62- assert not server .thread .is_alive ()
45+ def test_run_forever (self , threaded_server ):
46+ assert threaded_server .thread
47+ assert not isinstance (threaded_server .thread , threading ._MainThread )
48+ assert threaded_server .thread .is_alive ()
49+
50+ def test_shutdown (self , threaded_server ):
51+ assert threaded_server .thread .is_alive ()
52+ threaded_server .shutdown ()
53+ assert not threaded_server .thread .is_alive ()
6354
6455
6556def test_shutdown_abruptly (client_session ):
You can’t perform that action at this time.
0 commit comments