[issue18226] IDLE Unit test for FormatParagrah.py

2013-08-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: test.regrtest is semi-useless, at least for idle, in 2.7 -- see commit message. First run single file directly or python -m test.test_idle. -- ___ Python tracker _

[issue18226] IDLE Unit test for FormatParagrah.py

2013-08-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 47307e7c80e1 by Terry Jan Reedy in branch '2.7': Issue #18226: Fix ImportError and subsequent TypeError in 2.7 backport. http://hg.python.org/cpython/rev/47307e7c80e1 -- ___ Python tracker

[issue18226] IDLE Unit test for FormatParagrah.py

2013-08-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: Unless there is a buildbot problem, further enhancements of either file will be part of #18583 -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed superseder: -> Idle: enhance FormatParagraph _

[issue18226] IDLE Unit test for FormatParagrah.py

2013-08-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 453b4f89a2b4 by Terry Jan Reedy in branch '2.7': Issue #18226: Add docstrings and unittests for idlelib/FormatParagraph.py. http://hg.python.org/cpython/rev/453b4f89a2b4 New changeset bfdb687ca485 by Terry Jan Reedy in branch '3.3': Issue #18226: Ad

[issue18226] IDLE Unit test for FormatParagrah.py

2013-08-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: I got rid of the shutdown warning by replacing EditorWindow with a simple mock, as explained in the test file. Doing so also reduced the running time from about .40 seconds to .25 (it was 1.0+ before I reduced the redundancy of the tests). All the asserts pass

[issue18226] IDLE Unit test for FormatParagrah.py

2013-08-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Added tests to get 100% coverage (not counting in __name__ block). More test cleanups. Some of the extra newlines come from getting to 'end' instead of 'insert'. Others are avoided by adding newline to end of test strings, which is more realistic anyway. I comm

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Patch attached with current version. I noted in a comment that we should probably replace some of format_paragraph with textwrap.wrap. The find_paragraph test works fine with the current text mock. I split one test method and will probably do more. It could b

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-28 Thread Terry J. Reedy
Terry J. Reedy added the comment: Some comments on patch 6: 1. tearDownClass was omitted, resulting in boxes left on the screen, at least when running in Idle with win7. I added this to the README. I am also getting messages like "warning: callback failed in WindowList : invalid command name

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-24 Thread Phil Webster
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

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-19 Thread Phil Webster
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 is

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-17 Thread Terry J. Reedy
Terry J. Reedy added the comment: I am dubious that the current code will work with tkinter. Marks name slice positions. Tags name 0 to many pairs of slice positions, with 'sel' predefined as corresponding to a mouse selection and limited to one pair. According to my tests, tag_add('sel.first'

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-17 Thread Roger Serwy
Changes by Roger Serwy : -- nosy: +roger.serwy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-17 Thread Terry J. Reedy
Terry J. Reedy added the comment: What I think still needs to be done. * FormatParagraph.py: As near as I can tell from the patch, the comments are correct except that one is needed for reformat_paragraph. I gather that the substantive code change allows reformatting of a comment block when

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-17 Thread Phil Webster
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

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-17 Thread Phil Webster
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 commen

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-07 Thread Phil Webster
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

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-04 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- assignee: -> terry.reedy dependencies: +Idle: mock Text class and test thereof ___ Python tracker ___

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Phil (and Todd): I do not know what you mean by "behaves like more like an actual Text Widget" and whether you are talking about internal or external behavior. But I know that tk does not use an immutable string to hold the text. There is no such thing in C. T

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-01 Thread Todd Rovito
Todd Rovito added the comment: Terry, Thank you for the feedback this helps me alot! I will work with Phil Webster and will use his Text Widget and EditorWindow classes. Hopefully this will help us converge on a strong unit test for FormatParagraph.py. Thanks for the reminder about tripl

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-01 Thread Phil Webster
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

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: The patch models Text.data as a single string. But a tkinter Text contains a sequence of strings. While the single sequence works for the one test of the ...event method, a list of strings is needed for .get and many other methods with position parameters to a

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: The test passes as written, so I am not sure what 'mostly works' means. I said elsewhere, and revised README to match, that I changed my mind about test case names starting with 'Test'. Ending with 'Test' is much more common in /test and I decided from experie

[issue18226] IDLE Unit test for FormatParagrah.py

2013-07-01 Thread Todd Rovito
Todd Rovito added the comment: Here is a uncompleted patch but works for the most part. I thought I would post just in case somebody wanted to provide me comments on the general direction of the patch. The naming might have to change but this follows Terry Reedy's model of monkey patching. -

[issue18226] IDLE Unit test for FormatParagrah.py

2013-06-15 Thread Todd Rovito
Changes by Todd Rovito : -- nosy: +JayKrish ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue18226] IDLE Unit test for FormatParagrah.py

2013-06-15 Thread Todd Rovito
New submission from Todd Rovito: Continuing the IDLE unittest framework initiated in http://bugs.python.org/issue15392. A small unit test for IDLE FormatParagraph.py. This patch introduces a test module named test_format_paragraph.py inside Lib/idlelib/idle_test, considering the guidance in R