Skip to content

Commit 49f5783

Browse files
committed
Patch aturtle.canvas.tkinter so that window tests can run.
1 parent 14ca430 commit 49f5783

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_window.py

+8
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,16 @@ def setUp(self):
2929
)
3030
self.exit_stack = contextlib.ExitStack()
3131
self.exit_stack.enter_context(
32+
# Use FakeTkInter to support tk-based window creation in tests.
3233
mock.patch('aturtle.window.tkinter', self.tkinter)
3334
)
35+
self.exit_stack.enter_context(
36+
# Must be patched because canvas, imported by the window module,
37+
# defines a class inheriting from tkinter.Canvas, unavailable in
38+
# GitHub actions CI -- the import would fail at class definition
39+
# time, otherwise.
40+
mock.patch('aturtle.canvas.tkinter', self.tkinter)
41+
)
3442

3543

3644
def _Window(self, *args, **kwargs):

0 commit comments

Comments
 (0)