diff --git a/src/crystal/tests/util/controls.py b/src/crystal/tests/util/controls.py index a10b6a1a..be5454fb 100644 --- a/src/crystal/tests/util/controls.py +++ b/src/crystal/tests/util/controls.py @@ -47,16 +47,6 @@ def click_checkbox(checkbox: wx.CheckBox) -> None: # ------------------------------------------------------------------------------ # Utility: Controls: wx.FileDialog, wx.DirDialog -@contextmanager -def package_dialog_returning(filepath: str) -> Iterator[None]: - if project_appears_as_package_file(): - with file_dialog_returning(filepath): - yield - else: - with dir_dialog_returning(filepath): - yield - - @contextmanager def file_dialog_returning(filepath: str) -> Iterator[None]: with unittest.mock.patch('wx.FileDialog', spec=True) as MockFileDialog: diff --git a/src/crystal/tests/util/windows.py b/src/crystal/tests/util/windows.py index ea9697b3..502eafdc 100644 --- a/src/crystal/tests/util/windows.py +++ b/src/crystal/tests/util/windows.py @@ -4,7 +4,7 @@ from crystal.model import Project from crystal.tests.util.controls import ( - click_button, file_dialog_returning, package_dialog_returning, + click_button, file_dialog_returning, TreeItem ) from crystal.tests.util.runner import bg_sleep, pump_wx_events @@ -108,7 +108,7 @@ async def open(self, if readonly is not None: self.open_as_readonly.Value = readonly - with package_dialog_returning(project_dirpath): + with file_dialog_returning(project_dirpath): click_button(self.open_button) with screenshot_if_raises(): @@ -125,7 +125,7 @@ async def open(self, await mw.close(exc_info_while_close) async def start_opening(self, project_dirpath: str, *, next_window_name: str) -> None: - with package_dialog_returning(project_dirpath): + with file_dialog_returning(project_dirpath): click_button(self.open_button) await wait_for(