/opt/alt/python27/lib64/python2.7/idlelib/idle_test
NameSizeModeActions
htest.py137790644editdlrm
htest.pyc126520644editdlrm
htest.pyo126520644editdlrm
mock_idle.py15970644editdlrm
mock_idle.pyc30090644editdlrm
mock_idle.pyo30090644editdlrm
mock_tk.py115740644editdlrm
mock_tk.pyc127130644editdlrm
mock_tk.pyo127130644editdlrm
README.txt54920644editdlrm
test_autocomplete.py49220644editdlrm
test_autocomplete.pyc61200644editdlrm
test_autocomplete.pyo61200644editdlrm
test_autoexpand.py41220644editdlrm
test_autoexpand.pyc49620644editdlrm
test_autoexpand.pyo49620644editdlrm
test_calltips.py71400644editdlrm
test_calltips.pyc127680644editdlrm
test_calltips.pyo127680644editdlrm
test_configdialog.py7820644editdlrm
test_configdialog.pyc17200644editdlrm
test_configdialog.pyo17200644editdlrm
test_config_name.py24720644editdlrm
test_config_name.pyc41810644editdlrm
test_config_name.pyo41810644editdlrm
test_delegator.py12940644editdlrm
test_delegator.pyc13580644editdlrm
test_delegator.pyo13580644editdlrm
test_editmenu.py31670644editdlrm
test_editmenu.pyc45690644editdlrm
test_editmenu.pyo45690644editdlrm
test_formatparagraph.py143440644editdlrm
test_formatparagraph.pyc147080644editdlrm
test_formatparagraph.pyo147080644editdlrm
test_grep.py27620644editdlrm
test_grep.pyc39030644editdlrm
test_grep.pyo39030644editdlrm
test_helpabout.py16110644editdlrm
test_helpabout.pyc24410644editdlrm
test_helpabout.pyo24410644editdlrm
test_hyperparser.py56840644editdlrm
test_hyperparser.pyc69420644editdlrm
test_hyperparser.pyo69420644editdlrm
test_idlehistory.py54950644editdlrm
test_idlehistory.pyc84800644editdlrm
test_idlehistory.pyo84800644editdlrm
test_io.py95050644editdlrm
test_io.pyc119490644editdlrm
test_io.pyo119490644editdlrm
test_parenmatch.py38220644editdlrm
test_parenmatch.pyc56640644editdlrm
test_parenmatch.pyo56640644editdlrm
test_pathbrowser.py9400644editdlrm
test_pathbrowser.pyc15370644editdlrm
test_pathbrowser.pyo15370644editdlrm
test_rstrip.py16130644editdlrm
test_rstrip.pyc18250644editdlrm
test_rstrip.pyo18250644editdlrm
test_searchdialogbase.py58630644editdlrm
test_searchdialogbase.pyc70350644editdlrm
test_searchdialogbase.pyo70350644editdlrm
test_searchengine.py114870644editdlrm
test_searchengine.pyc131170644editdlrm
test_searchengine.pyo131170644editdlrm
test_text.py67440644editdlrm
test_text.pyc83950644editdlrm
test_text.pyo83950644editdlrm
test_textview.py28020644editdlrm
test_textview.pyc47130644editdlrm
test_textview.pyo47130644editdlrm
test_warning.py27570644editdlrm
test_warning.pyc33900644editdlrm
test_warning.pyo33900644editdlrm
test_widgetredir.py41770644editdlrm
test_widgetredir.pyc66440644editdlrm
test_widgetredir.pyo66440644editdlrm
__init__.py6500644editdlrm
__init__.pyc9410644editdlrm
__init__.pyo9410644editdlrm
Edit: /opt/alt/python27/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)