Skip to content

Commit ee650ef

Browse files
chore: fix test warnings
1 parent b5ed2b2 commit ee650ef

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

tests/scenario_test/test_get_hooks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ def setup_method(self):
1212
cli_args = [get_hooks.__name__, "--protocol", "message-boundaries", "--boundary", ""]
1313
self.argv_mock = patch.object(sys, "argv", cli_args)
1414
self.argv_mock.start()
15+
# Prevent unpredictable behavior from import order mismatch
16+
if get_hooks.__name__ in sys.modules:
17+
del sys.modules[get_hooks.__name__]
1518

1619
def teardown_method(self):
1720
self.argv_mock.stop()

tests/scenario_test/test_get_manifest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ def setup_method(self):
1717
self.argv_mock = patch.object(sys, "argv", cli_args)
1818
self.argv_mock.start()
1919
self.cwd = os.getcwd()
20+
# Prevent unpredictable behavior from import order mismatch
21+
if get_manifest.__name__ in sys.modules:
22+
del sys.modules[get_manifest.__name__]
2023

2124
def teardown_method(self):
2225
os.chdir(self.cwd)

tests/scenario_test/test_start.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def setup_method(self):
2727
self.argv_mock.start()
2828

2929
self.cwd = os.getcwd()
30+
# Prevent unpredictable behavior from import order mismatch
31+
if start.__name__ in sys.modules:
32+
del sys.modules[start.__name__]
3033

3134
def teardown_method(self):
3235
self.argv_mock.stop()

0 commit comments

Comments
 (0)