Skip to content

Commit 31da643

Browse files
Add exception for non GUI
1 parent a8d4113 commit 31da643

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

Lib/test/test_turtle_gui.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import unittest
22
from itertools import zip_longest
33
import os
4-
from tkinter import _tkinter, PhotoImage
54
import time
65
from test import support
76
from test.support import import_helper
87
from test.support import os_helper
98

10-
turtle = import_helper.import_module('turtle')
11-
129
try:
13-
t = turtle.Turtle()
14-
except turtle.Terminator:
15-
raise unittest.SkipTest("GUI required test")
10+
from tkinter import _tkinter, PhotoImage
11+
turtle = import_helper.import_module('turtle')
12+
except:
13+
raise unittest.SkipTest("This system is not configured for GUI tests.")
1614

1715

1816
def simulate_mouse_input(w, coords):
@@ -28,9 +26,7 @@ def simulate_mouse_input(w, coords):
2826

2927
square = ((0,0),(0,20),(20,20),(20,0))
3028

31-
@unittest.skipIf(
32-
os.getenv("GITHUB_ACTIONS"), "Skipping GUI test in GitHub Actions"
33-
)
29+
3430
class ScreenBaseTestCase(unittest.TestCase):
3531
def tearDown(self):
3632
turtle.bye()
@@ -252,4 +248,3 @@ def test_resize(self):
252248

253249
def test_get_window_size(self):
254250
self.assertTrue(turtle.getscreen()._window_size() == (640, 600))
255-

0 commit comments

Comments
 (0)