Skip to content

Preserve newlines when captured with capfd#7521

Merged
asottile merged 1 commit intopytest-dev:masterfrom
asottile:newlines_unaffected
Jul 20, 2020
Merged

Preserve newlines when captured with capfd#7521
asottile merged 1 commit intopytest-dev:masterfrom
asottile:newlines_unaffected

Conversation

@asottile
Copy link
Member

Resolves #7517

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.

@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