stuff, fmt
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import unittest
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
from IPython.core.interactiveshell import InteractiveShell
|
||||
|
||||
from ipython_demo.shell import Shell
|
||||
|
||||
|
||||
class TestMyIdeas(unittest.TestCase):
|
||||
def test_MY_two_instances(self):
|
||||
InteractiveShell1 = Shell("InteractiveShell1").init_shell()
|
||||
InteractiveShell2 = Shell("InteractiveShell2").init_shell()
|
||||
|
||||
def ok[T](
|
||||
resolve: Callable[[InteractiveShell], Any],
|
||||
method: Callable[[T, T], Any],
|
||||
) -> None:
|
||||
t1 = resolve(InteractiveShell1)
|
||||
t2 = resolve(InteractiveShell2)
|
||||
method(t1, t2)
|
||||
|
||||
ok(
|
||||
lambda shell: getattr(shell.history_manager, "outputs", None),
|
||||
self.assertIsNot,
|
||||
)
|
||||
ok(lambda shell: shell.display_formatter, self.assertIsNot)
|
||||
ok(lambda shell: shell.display_pub, self.assertIsNot)
|
||||
ok(lambda shell: shell.displayhook, self.assertIsNot)
|
||||
ok(lambda shell: shell.history_manager, self.assertIsNot)
|
||||
ok(lambda shell: shell.user_ns, self.assertIsNot)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user