Skip to content

Commit

Permalink
getOpenFileName returns tuple, not str
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Nov 4, 2024
1 parent 5947a2e commit 8962512
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion movement/napari/_loader_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _on_browse_clicked(self):
self.source_software_combo.currentText()
]

file_path = QFileDialog.getOpenFileName(
file_path, _ = QFileDialog.getOpenFileName(
self,
caption="Open file containing predicted poses",
filter=f"Poses files ({' '.join(file_suffixes)})",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_on_browse_clicked(file_path, make_napari_viewer_proxy, mocker):
# Mock the QFileDialog.getOpenFileName method to return the file path
mocker.patch(
"movement.napari._loader_widgets.QFileDialog.getOpenFileName",
return_value=file_path,
return_value=(file_path, None), # tuple(file_path, filter)
)
# Simulate the user clicking the 'Browse' button
poses_loader_widget._on_browse_clicked()
Expand Down

0 comments on commit 8962512

Please sign in to comment.