8000 bpo-30591: added test for textwrap backtracking by jonathaneunice · Pull Request #1988 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@jonathaneunice
Copy link
Contributor

Added test for special case when textwrap needs to backtrack to add placeholder.

According to my runs of nedbatchelder's coverage tool, those lines previously lacked test coverage.

# the last wrapped line so long that the placeholder
# cannot be added there without violence. So, textwrap
# backtracks and adds the placeholder to the penultimate
# line. This test exercises several lines that otherwise
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last sentence is not needed. We can say the same for virtually any test.

# have no test coverage.
text = 'Good grief Python features are advancing quickly!'
self.check_wrap(text, 12,
['Good grief', 'Python*****'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent continuation lines as in other tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review. Patches to indent and comment just pushed.

Copy link
Member
@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. I confirm that the new test covers the case not covered by other tests.

@serhiy-storchaka serhiy-storchaka added the tests Tests in the Lib/test dir label Jun 7, 2017
@serhiy-storchaka serhiy-storchaka merged commit 5edf827 into python:master Jun 7, 2017
@jonathaneunice jonathaneunice deleted the fix-issue-30591 branch June 7, 2017 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0