Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE reformat tests fail in presence of non-default FormatParagraph setting #65483

Closed
rhettinger opened this issue Apr 17, 2014 · 3 comments
Closed
Assignees
Labels
easy topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@rhettinger
Copy link
Contributor

BPO 21284
Nosy @rhettinger, @terryjreedy

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/terryjreedy'
closed_at = <Date 2014-04-22.05:13:27.761>
created_at = <Date 2014-04-17.15:19:38.994>
labels = ['easy', 'expert-IDLE', 'type-bug']
title = 'IDLE reformat tests fail in presence of non-default FormatParagraph setting'
updated_at = <Date 2014-04-22.05:13:27.760>
user = 'https://github.com/rhettinger'

bugs.python.org fields:

activity = <Date 2014-04-22.05:13:27.760>
actor = 'terry.reedy'
assignee = 'terry.reedy'
closed = True
closed_date = <Date 2014-04-22.05:13:27.761>
closer = 'terry.reedy'
components = ['IDLE']
creation = <Date 2014-04-17.15:19:38.994>
creator = 'rhettinger'
dependencies = []
files = []
hgrepos = []
issue_num = 21284
keywords = ['easy']
message_count = 3.0
messages = ['216695', '216819', '216985']
nosy_count = 3.0
nosy_names = ['rhettinger', 'terry.reedy', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue21284'
versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

@rhettinger
Copy link
Contributor Author

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:
  3. restoring the user's default configuration

@rhettinger rhettinger added topic-IDLE easy type-bug An unexpected behavior, bug, or error labels Apr 17, 2014
@terryjreedy
Copy link
Member

I noticed the same while working on bpo-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.

@terryjreedy terryjreedy self-assigned this Apr 19, 2014
@python-dev
Copy link
Mannequin

python-dev mannequin commented Apr 22, 2014

New changeset 4ff2c0a637cf by Terry Jan Reedy in branch '2.7':
bpo-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':
bpo-21284: Idle: make test_formatparagraph pass even when a user changes the
http://hg.python.org/cpython/rev/fe067339af80

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants