classification
Title: IDLE reformat tests fail in presence of non-default FormatParagraph setting
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.5, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: python-dev, rhettinger, terry.reedy
Priority: normal Keywords: easy

Created on 2014-04-17 15:19 by rhettinger, last changed 2014-04-22 05:13 by terry.reedy. This issue is now closed.

Messages (3)
msg216695 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-04-17 15:19
When a user sets FormatParagraph to anything other than 70,
test_idle.py has 4 failing tests:

test_comment_block (idlelib.idle_test.test_formatparagraph.FormatEventTest) ... FAIL
test_long_line (idlelib.idle_test.test_formatparagraph.FormatEventTest) ... FAIL
test_multiple_lines (idlelib.idle_test.test_formatparagraph.FormatEventTest) ... FAIL
test_short_line (idlelib.idle_test.test_formatparagraph.FormatEventTest) ... FAIL

The solution is to make these tests setup by:
  1) save the user's default configuration
  2) set the paragraph reformat width to 70
and tear-down by:
  1) restoring the user's default configuration
msg216819 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-04-19 00:26
I noticed the same while working on #21139 and posted there a patch, 21139-34-fpe.diff, that adds a limit parameter to .format_paragraph_event. Test could then specify a width for each test without touching the user configuration. Different tests could use different widths. An explicit width is already used for testing the implementaton functions called by this method.
msg216985 - (view) Author: Roundup Robot (python-dev) Date: 2014-04-22 05:12
New changeset 4ff2c0a637cf by Terry Jan Reedy in branch '2.7':
Issue 21284: Idle: make test_formatparagraph pass even when a user changes the
http://hg.python.org/cpython/rev/4ff2c0a637cf

New changeset fe067339af80 by Terry Jan Reedy in branch '3.4':
Issue 21284: Idle: make test_formatparagraph pass even when a user changes the
http://hg.python.org/cpython/rev/fe067339af80
History
Date User Action Args
2014-04-22 05:13:27terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-04-22 05:12:43python-devsetnosy: + python-dev
messages: + msg216985
2014-04-19 00:26:49terry.reedysetnosy: + terry.reedy
messages: + msg216819

assignee: terry.reedy
stage: needs patch -> patch review
2014-04-17 15:19:38rhettingercreate