Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/test_collection_export_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ def window(tmp_path, monkeypatch):
try:
ui = app.App()
break
except app.tk.TclError:
except (app.tk.TclError, RuntimeError) as exc:
# tkinterdnd2 wraps a failed "package require tkdnd" in a plain
# RuntimeError; treat that like the transient TclError it hides.
if isinstance(exc, RuntimeError) and "tkdnd" not in str(exc):
raise
partial = getattr(app.tk, "_default_root", None)
if partial is not None:
try:
Expand Down
8 changes: 6 additions & 2 deletions tests/test_ui_accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ def setUp(self) -> None:
self._second_doc = tmp_path / "Paper_Markierungen.pdf"
self._second_doc.write_bytes(b"%PDF-1.4\n%%EOF\n")

last_error: tk.TclError | None = None
last_error: Exception | None = None
for _attempt in range(3):
try:
self.app = DokuReader.App()
break
except tk.TclError as exc:
except (tk.TclError, RuntimeError) as exc:
# tkinterdnd2 wraps a failed "package require tkdnd" in a
# plain RuntimeError; treat it like the TclError it hides.
if isinstance(exc, RuntimeError) and "tkdnd" not in str(exc):
raise
last_error = exc
partial_root = getattr(tk, "_default_root", None)
if partial_root is not None:
Expand Down
Loading