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

Preserve newlines when captured with capfd #7521

Merged
merged 1 commit into from
Jul 20, 2020
Merged

Preserve newlines when captured with capfd #7521

merged 1 commit into from
Jul 20, 2020

Conversation

asottile
Copy link
Member

Resolves #7517

testing/test_capture.py Outdated Show resolved Hide resolved
Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

The "universal newlines" and newline argument are really terribly documented, but I think I got it now, and newline="" is the behavior we want for capture (even though it is not the default behavior for sys.stdout).

I figure for this tempfile the write behavior is not observable directly, only write+read, so the test covers all options.

changelog/7517.bugfix.rst Show resolved Hide resolved
@asottile asottile merged commit 6ecb8f5 into pytest-dev:master Jul 20, 2020
@asottile asottile deleted the newlines_unaffected branch July 20, 2020 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytest 6.0.0rc1: capfd.readouterr() converts \r to \n
5 participants