@@ -46,8 +46,8 @@ def mock_monitoring() -> Generator[mock.MagicMock, None, None]:
4646def test_get_local_executor (tmp_path : pathlib .Path ) -> None :
4747 run_dir = str (tmp_path / 'parsl' )
4848 config = ParslLocalConfig (run_dir = run_dir )
49- executor = config .get_executor ()
50- assert isinstance (executor , Executor )
49+ with config .get_executor () as executor :
50+ assert isinstance (executor , Executor )
5151
5252
5353def test_get_htex_executor (tmp_path : pathlib .Path , mock_monitoring ) -> None :
@@ -197,9 +197,12 @@ def test_htex_config() -> None:
197197 worker_port_range = [0 , 0 ],
198198 interchange_port_range = [0 , 0 ],
199199 )
200- assert isinstance (config .get_executor (), HighThroughputExecutor )
200+
201+ with config .get_executor () as executor :
202+ assert isinstance (executor , HighThroughputExecutor )
201203
202204
203205def test_htex_config_default () -> None :
204206 config = HTExConfig ()
205- assert isinstance (config .get_executor (), HighThroughputExecutor )
207+ with config .get_executor () as executor :
208+ assert isinstance (executor , HighThroughputExecutor )
0 commit comments