[issue18910] IDLE: Unit test for textView.py
New submission from Phil Webster: Started writing the tests for textView.py. -- components: IDLE files: test_textview.patch keywords: patch messages: 196820 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE: Unit test for textView.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31569/test_textview.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18910 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18592] IDLE: Unit test for SearchDialogBase.py
Phil Webster added the comment: Added tests for labels, a mock function for widget creation, a back option for radiobuttontests, and the docstring fixes that Terry mentioned. -- Added file: http://bugs.python.org/file31542/18592_test_searchdialog2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18592 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18409] IDLE Improvements: Unit test for AutoComplete.py
Phil Webster added the comment: I've attached my work so far in order to get feedback before I head too far in the wrong direction. I'm not sure if my addition of mock events and AutoCompleteWindow is the right way to go and I'm open to any guidance. -- keywords: +patch Added file: http://bugs.python.org/file31481/18409test_autocomplete1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18409 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18766] IDLE: Autocomplete in editor doesn't work for un-imported modules
New submission from Phil Webster: If you open a new editor window in IDLE, some modules will autocomplete (re, os, other common modules used by IDLE) and others will not (textwrap, datetime, ...). The current solution is to run your module or type the imports into the shell window to get completions working, which is not very intuitive. I created a patch that checks the namespace and attempts to import the module automatically if it is not found. -- components: IDLE files: autocomplete_unimported_1.patch keywords: patch messages: 195446 nosy: Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE: Autocomplete in editor doesn't work for un-imported modules type: behavior versions: Python 2.7, Python 3.3 Added file: http://bugs.python.org/file31332/autocomplete_unimported_1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18766 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18583] Idle: enhance FormatParagraph
Phil Webster added the comment: I've attached a patch that attempts to address the issues above. For the tests, I made some changes because the cursor doesn't end in exactly the same spot with line endings. Here's a quick summary of the changes: 1. Removed format_paragraph and format_comment methods because all text is treated the same and formatted in the event method. (The formatting code could be pulled out of the format_event method if needed.) 2. Added find_string_indices method to see if cursor is in string using the text widget's string tag. If the cursor is in a string, only the string lines are formatted. Before, if code immediately preceded or followed the string at the same indentation level, it was treated as part of the same paragraph. 3. If the text to be formatted ends with a triple quoted string on its own line (such as a docstring), the formatting code leaves the line alone. 4. If selection contains multiple paragraphs (separated by blank lines), it can format each one. Previously, only the first paragraph was formatted. Once I have some feedback, I can thoroughly check all of the tests and make sure that we're getting the expected behavior. -- keywords: +patch Added file: http://bugs.python.org/file31266/18583enhancefp1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18583 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18592] IDLE: Unit test for SearchDialogBase.py
Phil Webster added the comment: As suggested by Ezio, I factored out the button tests to a common method. -- Added file: http://bugs.python.org/file31220/test_searchdialogbase2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18592 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18583] Idle: enhance FormatParagraph
Phil Webster added the comment: In the case of no selection would it make sense to only format if the cursor is in a string/comment? If not in a string or comment, the single line that the cursor is in could be formatted with a line ending backslash or not at all. Otherwise Format Paragraph will probably just be mangling code. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18583 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18592] IDLE: Unit test for SearchDialogBase.py
New submission from Phil Webster: This is a basic set of tests for SearchDialogBase. It mainly consists of gui code, so I was not completely sure of how/what to test. Before venturing any further, I thought I would make sure I'm heading in the right direction. -- components: IDLE messages: 193911 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE: Unit test for SearchDialogBase.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18592 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18592] IDLE: Unit test for SearchDialogBase.py
Changes by Phil Webster webster.p...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file31082/test_searchdialogbase.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18592 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18583] Idle: enhance FormatParagraph
Changes by Phil Webster webster.p...@gmail.com: -- nosy: +philwebster ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18583 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18489] IDLE Unit test for SearchEngine.py
Phil Webster added the comment: Added tests for the rest of the SearchEngine module. I used the mock tkMessageBox for testing the error display, but used the tkinter Text widget for other tests because mark_set and tag_add/remove haven't been added to the mock yet. -- Added file: http://bugs.python.org/file31030/test_searchengine2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18489 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: This patch moves the comment_header code to reformat_comment, adds tests for reformat_comment, and implements the fix that Todd mentioned in #18429. In addition, I changed the get_comment_header and get_indent regular expressions to only look for spaces and tabs, rather than any whitespace ('\s'). These functions should only ever get single lines, but I don't think characters like newline would ever need to be part of the comment header. -- Added file: http://bugs.python.org/file31032/18226IDLEUnitTestFormatParagraph6.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18504] IDLE:Improvements- Improving Mock_Text
Changes by Phil Webster webster.p...@gmail.com: -- nosy: +philwebster ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18504 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: I added and rewrote tests to use the Text widget (when necessary). The only changes made to FormatParagraph are documentation/comment formatting and the if __main__ function. I will work on the comment header behavior separately and can post the patch in this issue. Thanks for your guidance Terry! -- Added file: http://bugs.python.org/file30982/18226IDLEUnitTestFormatParagraph5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: Added tests for FormatParagraph using single/multiline comment blocks and single/multiline strings in the mock editor window. Here is a summary of the changes: FormatParagraph.py - description for format_paragraph_event - modified so that selecting a long comment line will comment the new wrapped line - if __name__ == __main__... mock_tk.py - FormatParagraph uses the 'insert' tag, so I implemented tag_add using a dict (not sure if this is the best option...) - index returns '' if the index refers to selection that doesn't exist (this replicates the real Text widget). It does this by excepting a TypeError and I'm guessing there is a better way to do it than this. - tags (i.e. 'sel.first') can be set to 'end' or other indexes which would not work with a regular Text widget, but it may be useful here. mock_idle.py - added undo start/stop for the mock text widget - used 'sel.first' and 'sel.last' for get_selection_indices() test_rstrip.py - This test used the 'insert' tag, so I set 'insert' to an index to keep the tests passing. test_text.py - Same issue with 'insert' as test_rstrip Should I be submitting multiple patches for these changes or is it ok to combine them? I was also wondering if it would be a good idea to split up the FormatParagraph tests into separate tests. -- Added file: http://bugs.python.org/file30947/18226IDLEUnitTestFormatParagraph3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: After reading Terry's comments on the initial patch I turned FormatParagraph's initial comments into a docstring and made sure that all lines were 80 characters. -- Added file: http://bugs.python.org/file30960/18226IDLEUnitTestFormatParagraph4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18489] IDLE Unit test for SearchEngine.py
New submission from Phil Webster: This test uses the mock text widget to search forwards and backwards, with and without wrapping. It also tests for empty matches with the 'ok' flag set in search_text(). The patch relies on the mock text tag_add function implemented in #18226. -- components: IDLE files: test_searchengine.patch keywords: patch messages: 193266 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Unit test for SearchEngine.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file30961/test_searchengine.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18489 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18365] Idle: mock Text class and test thereof
Phil Webster added the comment: Using tk.Text for more involved tests sounds good (at least as a start). The pass functions were used to get the FormatParagraph test (#18226) working. I've been using the same effbot.org site as a reference and haven't found anything more detailed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18365 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18365] Idle: mock Text class and test thereof
Phil Webster added the comment: Thanks Terry, I will start PEP8-checking my code before I submit (as well as testing more thoroughly). I was thinking the same thing about the logic behind _decode and index functions needing to be combined. How would you recommend adding functionality to the decode function to handle expressions like 1.2 +5 chars or 1.0 lineend-5c? AutoComplete.py (#18409) uses this kind of index, so it will be needed soon. I'm thinking that splitting off the base index then parsing the remaining modifier expressions is the way to go. I was also thinking that a _checkIndex method would be good to have especially when using the +/-line and +/-char expressions. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18365 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18425] IDLE Unit test for IdleHistory.py
Changes by Phil Webster webster.p...@gmail.com: -- nosy: +philwebster ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18425 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18409] IDLE Improvements: Unit test for AutoComplete.py
New submission from Phil Webster: I've started writing this test which depends on #18365. -- components: IDLE messages: 192711 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Improvements: Unit test for AutoComplete.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18409 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18410] IDLE Improvements: Unit test for SearchDialog.py
New submission from Phil Webster: Continuing the IDLE unittest framework from #15392. Depends on #18365. -- components: IDLE messages: 192713 nosy: JayKrish, Todd.Rovito, philwebster, terry.reedy priority: normal severity: normal status: open title: IDLE Improvements: Unit test for SearchDialog.py type: enhancement versions: Python 2.7, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18410 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: I made slight modifications to Todd's initial patch to test the mock Text widget from #18365. Thank you for the helpful feedback Terry! -- Added file: http://bugs.python.org/file30853/18226IDLEUnitTestFormatParagraph2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18365] Idle: mock Text class and test thereof
Phil Webster added the comment: Added Text class to mock_tk.py and GUI/non-GUI tests in test_text.py. Running the IDLE tests produced no errors for me. -- keywords: +patch Added file: http://bugs.python.org/file30851/mock_text.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18365 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Phil Webster added the comment: This patch contains mock_idle.py and the rstrip test using the mock text widget from #18365. Terry- For some reason, the Text widget always contains a '\n' as the last character even when there is nothing visible. Doing a text.get('1.0','end') always has a '\n' at the end from what I can tell. I'm not sure about the filename changing, is it worth creating a new issue for? -- Added file: http://bugs.python.org/file30852/test_rstrip3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Phil Webster added the comment: Added to Terry's Text Widget code (in #18226) and created mock_idle.py for the mock EditorWindow. Todd's FormatParagraph test in the aforementioned issue also passes with the mock EditorWindow. -- Added file: http://bugs.python.org/file30777/test_rstrip2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18226] IDLE Unit test for FormatParagrah.py
Phil Webster added the comment: I'm not sure if this is worth pursuing, but I made a mock Text Widget that behaves more like an actual Text Widget. I've attached my modified mock_tk.py which I used to create a mock editor window. This works for the test I made in #18279, but I am also working on a version similar to Todd's for that issue. -- Added file: http://bugs.python.org/file30746/mock_tk.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18226 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18292] IDLE Improvements: Unit test for AutoExpand.py
Changes by Phil Webster webster.p...@gmail.com: -- nosy: +philwebster ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18292 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Phil Webster added the comment: Modified the first patch to get rid of mock EditorWindow in favor of the real thing. Also renamed the test to 'test_rstrip'. -- Added file: http://bugs.python.org/file30694/test_rstrip.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
New submission from Phil Webster: This is a single test for RstripExtension.py, following from #15392. I also added a mock EditorWindow module with a Text widget for testing. test_rstripextension.py seems to run fine inside IDLE and produces the following output: test_do_rstrip (__main__.Test_rstripextension) ... ok -- Ran 1 test in 0.100s OK However, when I run via the command line, I get the following output: philwebster@ubuntu:~/Dev/cpython$ ./python -m test -ugui test_idle [1/1] test_idle Warning -- warnings.showwarning was modified by test_idle 1 test altered the execution environment: test_idle I attempted to replicate the results from #18189, but saw the same message. Any thoughts? -- components: IDLE messages: 191618 nosy: JayKrish, philwebster priority: normal severity: normal status: open title: IDLE Unit test for RstripExtension.py type: enhancement versions: Python 2.7, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Changes by Phil Webster webster.p...@gmail.com: -- nosy: +Todd.Rovito ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Changes by Phil Webster webster.p...@gmail.com: -- nosy: +terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Changes by Phil Webster webster.p...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file30664/test_rstripext.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18279] IDLE Unit test for RstripExtension.py
Phil Webster added the comment: Thank you for the feedback Terry. I'm not seeing the traceback without '-ugui' either, so I'm going to look into that. I get the same results with requires('gui') moved inside of setUp, is that what you mean by wrapping? For mock_ewin I used a real Text widget because RstripExtension uses index(), get(), and delete() and I was not able to figure out how the widget implemented these (is there a single string with the contents?). I can work on a non-gui test though if that's what needs to be done. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18279 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18103] Create a GUI test framework for Idle
Changes by Phil Webster webster.p...@gmail.com: -- nosy: +philwebster ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18103 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13657] IDLE doesn't support sys.ps1 and sys.ps2.
Phil Webster added the comment: I've attached a patch that attempts to get sys.ps1 for the prompt. Unfortunately it prints out blue because it is treated as output from running print(sys.ps1) as if the user had typed it in. Now that I have a better understanding of the issue, I may be able to work on the subprocess handling that Roger suggested. -- keywords: +patch nosy: +philwebster Added file: http://bugs.python.org/file30303/issue13657.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13657 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2704] IDLE: Patch to make PyShell behave more like a Terminal interface
Phil Webster added the comment: After reading about beginners having difficulty with IDLE's terminal behavior, I wrote a (very) simple patch to disable left clicking in the text area. I realize that this doesn't solve the problem completely (and the fact that there is already a patch here), but I wanted to become familiar with the contribution process. Thanks for your patience with me! -- nosy: +philwebster Added file: http://bugs.python.org/file30173/Issue2704.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2704 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com