test: fix TestShell initialization and reset()

This commit is contained in:
Brandon Odiwuor committed 2025-02-20 15:25:43 +03:00
1 parent ebe4cac38b
commit 303f8cca05
2 files changed
+13 -9

No files matched your search

+4 -3
View File
@@ -61,7 +61,8 @@ class TestShell:
print("Shutdown TestShell before resetting!")
else:
self.num_nodes = None
super().__init__()
dummy_testshell_file = pathlib.Path(__file__).absolute().parent.parent / "testshell_dummy.py"
super().__init__(dummy_testshell_file)
instance = None
@@ -74,8 +75,8 @@ class TestShell:
# cache. Since TestShell is meant for interactive use, there is no concrete
# test; passing a dummy name is fine though, as only the containing directory
# is relevant for successful initialization.
tests_directory = pathlib.Path(__file__).resolve().parent.parent
TestShell.instance = TestShell.__TestShell(tests_directory / "testshell_dummy.py")
dummy_testshell_file = pathlib.Path(__file__).absolute().parent.parent / "testshell_dummy.py"
TestShell.instance = TestShell.__TestShell(dummy_testshell_file)
TestShell.instance.running = False
return TestShell.instance