Skip to content

In tests, sys.stderr.write does not return the number of characters written #6557

Description

@gavento

Within tests, sys.stderr.write does not return the number of characters written as write should.
This originates in EncodedFile.write which returns None, missing a return statement.

A minimal test (needs to be run as a test by pytest):

def test_stderr():
    assert sys.stderr.write("A") > 0

I am using pytest 5.2.1 but the code in master is the same.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: capturerelated to the capture builtin plugintype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions