Skip to content

Commit

Permalink
tests: Skip gui_tests if a RuntimeError occures with tkinter
Browse files Browse the repository at this point in the history
Bug: T380732
Change-Id: I2c9176f0af694d9cdc828730b04156876f010357
  • Loading branch information
xqt committed Nov 25, 2024
1 parent 13b4fe8 commit a3125f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/gui_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,17 @@ def setUpModule():

# pypy3 has a tkinter module which just raises importError if _tkinter
# is not installed; thus require_modules does not work for it.
# pypy3.10 has a version mismatch, see T380732.
try:
import tkinter
except ImportError as e:
raise unittest.SkipTest(e)

try:
tkinter.Tk()
except RuntimeError as e:
raise unittest.SkipTest(f'Skipping due to T380732 - {e}')

from pywikibot.userinterfaces.gui import EditBoxWindow, Tkdialog


Expand Down

0 comments on commit a3125f8

Please sign in to comment.