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 it is properly selected (with the beginning at the beginning of the 
line). The proof will be in the testing.

The middle of format_paragraph_event currently looks like

    if comment_header:
        <bunch of no-gui code>
    else:
        newdata = reformat_paragraph(data, maxformatwidth)

where reformat_paragraph is no-gui code. The comment formatting code should be 
pulled out into a no-gui reformat_comment function (with docstring) and 
replaced with in its current location with
newdata = reformat_comment(data, maxformatwidth, comment_header).

* test_formatparagraph.py:

As I hinted before, the test file should begin with the simplest functions and 
those that do not require widgets (or mocks thereof). In the initial idle test 
issue #15392, Nick recommended "As much as possible, push logic testing down 
into the non-GUI tests." This is easiet when non-gui logic and widget 
manipulation are isolated in different function. When logic has already been 
pushed into non-gui functions, they should normally be tested first.
 
Is_Get_Test (with methods for is_ and get_ functions)
ReformatCommentTest
ReformatParagraphTest
  would be straightforward text test cases.

FindTest
FormatEventTest (split into multiple test cases)
  require widgets.

If the helper functions do not work, the functions that use them will not work. 
So FormatEventTest does not really test the method unless all the other tests 
pass.

For this file, there is the additional factor that the latter test cases (or 
groups of test cases) require Text methods that do not currently exist and will 
not be added immediately. See my message on #18425, as well as below. So they 
should first be implemented using the tk Text widget and requires('gui').

An advantage of starting with real widgets is that it separates problems with 
the tested and test files from problems with the mocks. Remember that mocks are 
only needed for the buildbots, not our desktops with graphics screens. 

I have not yet looked at the individual tests, but please do a patch for only 
these two files.

----------
stage:  -> patch review

_______________________________________
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

Reply via email to