mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-45229: Make tkinter tests discoverable (GH-28637)
This commit is contained in:
parent
676201a59f
commit
f59ed3c310
18 changed files with 496 additions and 604 deletions
|
@ -1,6 +1,6 @@
|
|||
import unittest
|
||||
import tkinter
|
||||
from test.support import requires, run_unittest, swap_attr
|
||||
from test.support import requires, swap_attr
|
||||
from tkinter.test.support import AbstractDefaultRootTest, AbstractTkTest
|
||||
from tkinter import colorchooser
|
||||
from tkinter.colorchooser import askcolor
|
||||
|
@ -64,7 +64,5 @@ class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
|
|||
self.assertRaises(RuntimeError, askcolor)
|
||||
|
||||
|
||||
tests_gui = (ChooserTest, DefaultRootTest,)
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import unittest
|
||||
import tkinter
|
||||
from tkinter import font
|
||||
from test.support import requires, run_unittest, gc_collect, ALWAYS_EQ
|
||||
from test.support import requires, gc_collect, ALWAYS_EQ
|
||||
from tkinter.test.support import AbstractTkTest, AbstractDefaultRootTest
|
||||
|
||||
requires('gui')
|
||||
|
@ -159,7 +159,5 @@ class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
|
|||
self.assertRaises(RuntimeError, font.nametofont, fontname)
|
||||
|
||||
|
||||
tests_gui = (FontTest, DefaultRootTest)
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
|
@ -376,7 +376,5 @@ class PhotoImageTest(AbstractTkTest, unittest.TestCase):
|
|||
self.assertEqual(image.transparency_get(4, 6), False)
|
||||
|
||||
|
||||
tests_gui = (MiscTest, DefaultRootTest, BitmapImageTest, PhotoImageTest,)
|
||||
|
||||
if __name__ == "__main__":
|
||||
support.run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
|
@ -41,7 +41,6 @@ class TkLoadTest(unittest.TestCase):
|
|||
self.assertRaises(TclError, tcl.winfo_geometry)
|
||||
self.assertRaises(TclError, tcl.loadtk)
|
||||
|
||||
tests_gui = (TkLoadTest, )
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_support.run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import unittest
|
||||
import tkinter
|
||||
from test.support import requires, run_unittest, swap_attr
|
||||
from test.support import requires, swap_attr
|
||||
from tkinter.test.support import AbstractDefaultRootTest
|
||||
from tkinter.commondialog import Dialog
|
||||
from tkinter.messagebox import showinfo
|
||||
|
@ -32,7 +32,5 @@ class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
|
|||
self.assertRaises(RuntimeError, showinfo, "Spam", "Egg Information")
|
||||
|
||||
|
||||
tests_gui = (DefaultRootTest,)
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
|
@ -390,7 +390,5 @@ class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
|
|||
self.assertRaises(RuntimeError, tkinter.mainloop)
|
||||
|
||||
|
||||
tests_gui = (MiscTest, DefaultRootTest)
|
||||
|
||||
if __name__ == "__main__":
|
||||
support.run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import unittest
|
||||
import tkinter
|
||||
from test.support import requires, run_unittest, swap_attr
|
||||
from test.support import requires, swap_attr
|
||||
from tkinter.test.support import AbstractDefaultRootTest
|
||||
from tkinter.simpledialog import Dialog, askinteger
|
||||
|
||||
|
@ -31,7 +31,5 @@ class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
|
|||
self.assertRaises(RuntimeError, askinteger, "Go To Line", "Line number")
|
||||
|
||||
|
||||
tests_gui = (DefaultRootTest,)
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import unittest
|
||||
import tkinter
|
||||
from test.support import requires, run_unittest
|
||||
from test.support import requires
|
||||
from tkinter.test.support import AbstractTkTest
|
||||
|
||||
requires('gui')
|
||||
|
@ -41,7 +41,5 @@ class TextTest(AbstractTkTest, unittest.TestCase):
|
|||
self.assertEqual(text.search('test', '1.0', 'end'), '1.3')
|
||||
|
||||
|
||||
tests_gui = (TextTest, )
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
|
@ -338,10 +338,5 @@ class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
|
|||
self.assertRaises(RuntimeError, Variable)
|
||||
|
||||
|
||||
tests_gui = (TestVariable, TestStringVar, TestIntVar,
|
||||
TestDoubleVar, TestBooleanVar, DefaultRootTest)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from test.support import run_unittest
|
||||
run_unittest(*tests_gui)
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue