forked from python/cpython
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpo-33855: Minimally test all IDLE modules. (pythonGH-7689)
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es). Add a test file for all non-startup IDLE modules. Edit existing files and update coverage. This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files.
- Loading branch information
1 parent
6c5a4b3
commit ee5ef30
Showing
34 changed files
with
420 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"Test , coverage %." | ||
|
||
from idlelib import | ||
import unittest | ||
from test.support import requires | ||
from tkinter import Tk | ||
|
||
|
||
class Test(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
requires('gui') | ||
cls.root = Tk() | ||
cls.root.withdraw() | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
cls.root.update_idletasks() | ||
## for id in cls.root.tk.call('after', 'info'): | ||
## cls.root.after_cancel(id) # Need for EditorWindow. | ||
cls.root.destroy() | ||
del cls.root | ||
|
||
def test_init(self): | ||
self.assert | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main(verbosity=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"Test autocomplete_w, coverage 11%." | ||
|
||
import unittest | ||
from test.support import requires | ||
from tkinter import Tk, Text | ||
|
||
import idlelib.autocomplete_w as acw | ||
|
||
|
||
class AutoCompleteWindowTest(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
requires('gui') | ||
cls.root = Tk() | ||
cls.root.withdraw() | ||
cls.text = Text(cls.root) | ||
cls.acw = acw.AutoCompleteWindow(cls.text) | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
del cls.text, cls.acw | ||
cls.root.update_idletasks() | ||
cls.root.destroy() | ||
del cls.root | ||
|
||
def test_init(self): | ||
self.assertEqual(self.acw.widget, self.text) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main(verbosity=2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"Test calltip_w, coverage 18%." | ||
|
||
from idlelib import calltip_w | ||
import unittest | ||
from test.support import requires | ||
from tkinter import Tk, Text | ||
|
||
|
||
class CallTipTest(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
requires('gui') | ||
cls.root = Tk() | ||
cls.root.withdraw() | ||
cls.text = Text(cls.root) | ||
cls.calltip = calltip_w.CallTip(cls.text) | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
cls.root.update_idletasks() | ||
cls.root.destroy() | ||
del cls.text, cls.root | ||
|
||
def test_init(self): | ||
self.assertEqual(self.calltip.widget, self.text) | ||
|
||
if __name__ == '__main__': | ||
unittest.main(verbosity=2) |
Oops, something went wrong.