fmt
This commit is contained in:
+9
-12
@@ -1,7 +1,11 @@
|
||||
import asyncio
|
||||
import unittest
|
||||
|
||||
from ipython_shell.jupyter.transport import InputRequest, JupyterTransport, KernelMessage
|
||||
from ipython_shell.jupyter.transport import (
|
||||
InputRequest,
|
||||
JupyterTransport,
|
||||
KernelMessage,
|
||||
)
|
||||
|
||||
|
||||
class TransportTests(unittest.TestCase):
|
||||
@@ -24,9 +28,7 @@ class AsyncTransportTests(unittest.IsolatedAsyncioTestCase):
|
||||
await transport.start()
|
||||
try:
|
||||
call_id = await transport.execute("2 + 2")
|
||||
messages = [
|
||||
message async for message in transport.messages_for(call_id)
|
||||
]
|
||||
messages = [message async for message in transport.messages_for(call_id)]
|
||||
finally:
|
||||
await transport.shutdown()
|
||||
|
||||
@@ -72,19 +74,14 @@ class AsyncTransportTests(unittest.IsolatedAsyncioTestCase):
|
||||
await transport.start()
|
||||
try:
|
||||
call_id = await transport.execute(
|
||||
"import matplotlib.pyplot as plt\n"
|
||||
"plt.plot([1, 2, 3], [4, 5, 6])"
|
||||
"import matplotlib.pyplot as plt\nplt.plot([1, 2, 3], [4, 5, 6])"
|
||||
)
|
||||
messages = [
|
||||
message async for message in transport.messages_for(call_id)
|
||||
]
|
||||
messages = [message async for message in transport.messages_for(call_id)]
|
||||
finally:
|
||||
await transport.shutdown()
|
||||
|
||||
display = next(
|
||||
message
|
||||
for message in messages
|
||||
if message.msg_type == "display_data"
|
||||
message for message in messages if message.msg_type == "display_data"
|
||||
)
|
||||
self.assertIn("image/png", display.content["data"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user