Skip to content

Commit

Permalink
improve cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Dec 5, 2023
1 parent 2dccb05 commit a16ea99
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ async def test_namespace(self):
assert killed
assert not terminal.ptyproc.isalive()
assert terminal.ptyproc.closed
[tm.close() for tm in tms]

@tornado.testing.gen_test
@pytest.mark.skipif("linux" not in platform, reason="It only works on Linux")
Expand All @@ -260,6 +261,8 @@ async def test_max_terminals(self):
tm = await self.get_term_client(urls[MAX_TERMS])
msg = await tm.read_msg()
self.assertEqual(msg, None) # Connection closed
tm.close()
[tm.close() for tm in tms]


class SingleTermTests(TermTestCase):
Expand All @@ -273,6 +276,7 @@ async def test_single_process(self):
killed = await self.single_tm.terminal.terminate(True)
assert killed
assert self.single_tm.terminal.ptyproc.closed
[tm.close() for tm in tms]


class UniqueTermTests(TermTestCase):
Expand All @@ -281,6 +285,7 @@ async def test_unique_processes(self):
tms = await self.get_term_clients(["/unique", "/unique"])
pids = await self.get_pids(tms)
self.assertNotEqual(pids[0], pids[1])
[tm.close() for tm in tms]

@tornado.testing.gen_test
@pytest.mark.skipif("linux" not in platform, reason="It only works on Linux")
Expand All @@ -303,6 +308,7 @@ async def test_max_terminals(self):
tm = await self.get_term_client("/unique")
msg = await tm.read_msg()
self.assertEqual(msg[0], "setup")
tm.close()

@tornado.testing.gen_test
@pytest.mark.timeout(timeout=ASYNC_TEST_TIMEOUT, method="thread")
Expand Down

0 comments on commit a16ea99

Please sign in to comment.