Skip to content

--version writes to stderr #8246

Closed
@K3UL

Description

@K3UL

Hello,
When calling pytest --version, Pytest writes the version to stderr, which should be stdout I think. This is a problem to create automation tooling around it.

Example :

import subprocess
res = subprocess.run(["pytest", "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
res

> CompletedProcess(args=['pytest', '--version'], returncode=0, stdout=b'', stderr=b'pytest 6.1.2\r\n')

Context :

Pytest  6.1.2
Python  3.9.0
Windows 10 20H2

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: reportingrelated to terminal output and user-facing messages and errorstype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions