Skip to content

Commit 1db1ab5

Browse files
committed
TST: shim mainloop in testing backend
1 parent d735556 commit 1db1ab5

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

mpl_gui/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ def show(figs, *, block=None, timeout=0):
7676
block = not is_interactive()
7777

7878
if block and len(managers):
79-
# TODO expose the main loop more elegantly!
80-
# TODO make timeout work!
8179
if timeout == 0:
8280
_cbm().Show().mainloop()
8381
elif len(managers):

mpl_gui/tests/conftest.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from matplotlib.backend_bases import _Backend, FigureCanvasBase, FigureManagerBase
1+
from matplotlib.backend_bases import (
2+
_Backend,
3+
FigureCanvasBase,
4+
FigureManagerBase,
5+
ShowBase,
6+
)
27
import mpl_gui
38
import sys
49

@@ -28,9 +33,15 @@ def destroy(self):
2833
self.call_info["destroy"] = {}
2934

3035

36+
class TestShow(ShowBase):
37+
def mainloop(self):
38+
...
39+
40+
3141
class TestingBackend(_Backend):
3242
FigureCanvas = TestCanvas
3343
FigureManager = TestManger
44+
Show = TestShow
3445

3546

3647
mpl_gui.switch_backend(TestingBackend)

0 commit comments

Comments
 (0)