/usr/lib64/python2.7/idlelib/idle_test
NameSizeModeActions
htest.py137790644editdlrm
htest.pyc126000644editdlrm
htest.pyo126000644editdlrm
mock_idle.py15970644editdlrm
mock_idle.pyc28790644editdlrm
mock_idle.pyo28790644editdlrm
mock_tk.py115740644editdlrm
mock_tk.pyc123620644editdlrm
mock_tk.pyo123620644editdlrm
README.txt54920644editdlrm
test_autocomplete.py49220644editdlrm
test_autocomplete.pyc58600644editdlrm
test_autocomplete.pyo58600644editdlrm
test_autoexpand.py41220644editdlrm
test_autoexpand.pyc48060644editdlrm
test_autoexpand.pyo48060644editdlrm
test_calltips.py71400644editdlrm
test_calltips.pyc121310644editdlrm
test_calltips.pyo121310644editdlrm
test_configdialog.py7820644editdlrm
test_configdialog.pyc16550644editdlrm
test_configdialog.pyo16550644editdlrm
test_config_name.py24720644editdlrm
test_config_name.pyc40120644editdlrm
test_config_name.pyo40120644editdlrm
test_delegator.py12940644editdlrm
test_delegator.pyc13190644editdlrm
test_delegator.pyo13190644editdlrm
test_editmenu.py31670644editdlrm
test_editmenu.pyc44390644editdlrm
test_editmenu.pyo44390644editdlrm
test_formatparagraph.py143440644editdlrm
test_formatparagraph.pyc143180644editdlrm
test_formatparagraph.pyo143180644editdlrm
test_grep.py27620644editdlrm
test_grep.pyc37600644editdlrm
test_grep.pyo37600644editdlrm
test_helpabout.py16110644editdlrm
test_helpabout.pyc23630644editdlrm
test_helpabout.pyo23630644editdlrm
test_hyperparser.py56840644editdlrm
test_hyperparser.pyc67340644editdlrm
test_hyperparser.pyo67340644editdlrm
test_idlehistory.py54950644editdlrm
test_idlehistory.pyc81420644editdlrm
test_idlehistory.pyo81420644editdlrm
test_io.py95050644editdlrm
test_io.pyc115330644editdlrm
test_io.pyo115330644editdlrm
test_parenmatch.py38220644editdlrm
test_parenmatch.pyc54560644editdlrm
test_parenmatch.pyo54560644editdlrm
test_pathbrowser.py9400644editdlrm
test_pathbrowser.pyc14850644editdlrm
test_pathbrowser.pyo14850644editdlrm
test_rstrip.py16130644editdlrm
test_rstrip.pyc17730644editdlrm
test_rstrip.pyo17730644editdlrm
test_searchdialogbase.py58630644editdlrm
test_searchdialogbase.pyc68270644editdlrm
test_searchdialogbase.pyo68270644editdlrm
test_searchengine.py114870644editdlrm
test_searchengine.pyc126490644editdlrm
test_searchengine.pyo126490644editdlrm
test_text.py67440644editdlrm
test_text.pyc81480644editdlrm
test_text.pyo81480644editdlrm
test_textview.py28020644editdlrm
test_textview.pyc45310644editdlrm
test_textview.pyo45310644editdlrm
test_warning.py27570644editdlrm
test_warning.pyc32860644editdlrm
test_warning.pyo32860644editdlrm
test_widgetredir.py41770644editdlrm
test_widgetredir.pyc63840644editdlrm
test_widgetredir.pyo63840644editdlrm
__init__.py6500644editdlrm
__init__.pyc9150644editdlrm
__init__.pyo9150644editdlrm
Edit: /usr/lib64/python2.7/idlelib/idle_test/test_warning.py (2757B)
'''Test warnings replacement in PyShell.py and run.py. This file could be expanded to include traceback overrides (in same two modules). If so, change name. Revise if output destination changes (http://bugs.python.org/issue18318). Make sure warnings module is left unaltered (http://bugs.python.org/issue18081). ''' import unittest from test.test_support import captured_stderr import warnings # Try to capture default showwarning before Idle modules are imported. showwarning = warnings.showwarning # But if we run this file within idle, we are in the middle of the run.main loop # and default showwarnings has already been replaced. running_in_idle = 'idle' in showwarning.__name__ from idlelib import run from idlelib import PyShell as shell # The following was generated from PyShell.idle_formatwarning # and checked as matching expectation. idlemsg = ''' Warning (from warnings module): File "test_warning.py", line 99 Line of code UserWarning: Test ''' shellmsg = idlemsg + ">>> " class RunWarnTest(unittest.TestCase): @unittest.skipIf(running_in_idle, "Does not work when run within Idle.") def test_showwarnings(self): self.assertIs(warnings.showwarning, showwarning) run.capture_warnings(True) self.assertIs(warnings.showwarning, run.idle_showwarning_subproc) run.capture_warnings(False) self.assertIs(warnings.showwarning, showwarning) def test_run_show(self): with captured_stderr() as f: run.idle_showwarning_subproc( 'Test', UserWarning, 'test_warning.py', 99, f, 'Line of code') # The following uses .splitlines to erase line-ending differences self.assertEqual(idlemsg.splitlines(), f.getvalue().splitlines()) class ShellWarnTest(unittest.TestCase): @unittest.skipIf(running_in_idle, "Does not work when run within Idle.") def test_showwarnings(self): self.assertIs(warnings.showwarning, showwarning) shell.capture_warnings(True) self.assertIs(warnings.showwarning, shell.idle_showwarning) shell.capture_warnings(False) self.assertIs(warnings.showwarning, showwarning) def test_idle_formatter(self): # Will fail if format changed without regenerating idlemsg s = shell.idle_formatwarning( 'Test', UserWarning, 'test_warning.py', 99, 'Line of code') self.assertEqual(idlemsg, s) def test_shell_show(self): with captured_stderr() as f: shell.idle_showwarning( 'Test', UserWarning, 'test_warning.py', 99, f, 'Line of code') self.assertEqual(shellmsg.splitlines(), f.getvalue().splitlines()) if __name__ == '__main__': unittest.main(verbosity=2, exit=False)