Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d4f0963 + 680b957 commit 5673e33Copy full SHA for 5673e33
lib/matplotlib/tests/test_font_manager.py
@@ -253,11 +253,16 @@ def _test_threading():
253
from matplotlib.ft2font import LOAD_NO_HINTING
254
import matplotlib.font_manager as fm
255
256
+ def loud_excepthook(args):
257
+ raise RuntimeError("error in thread!")
258
+
259
+ threading.excepthook = loud_excepthook
260
261
N = 10
262
b = threading.Barrier(N)
263
264
def bad_idea(n):
- b.wait()
265
+ b.wait(timeout=5)
266
for j in range(100):
267
font = fm.get_font(fm.findfont("DejaVu Sans"))
268
font.set_text(str(n), 0.0, flags=LOAD_NO_HINTING)
@@ -271,7 +276,9 @@ def bad_idea(n):
271
276
t.start()
272
277
273
278
for t in threads:
274
- t.join()
279
+ t.join(timeout=9)
280
+ if t.is_alive():
281
+ raise RuntimeError("thread failed to join")
275
282
283
284
def test_fontcache_thread_safe():
0 commit comments