mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
add test.
This commit is contained in:
parent
b5a534d617
commit
1e04e34103
1 changed files with 9 additions and 0 deletions
|
|
@ -104,6 +104,15 @@ async def test_terminate():
|
|||
|
||||
time.sleep(2)
|
||||
assert executor.nb_client.km is None
|
||||
for _ in range(200):
|
||||
executor = ExecuteNbCode()
|
||||
await executor.run(code='print("This is a code!")', language="python")
|
||||
is_kernel_alive = await executor.nb_client.km.is_alive()
|
||||
assert is_kernel_alive
|
||||
await executor.terminate()
|
||||
assert executor.nb_client.km is None
|
||||
assert executor.nb_client.kc is None
|
||||
await executor.terminate()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue