Skip to content

Unable to log/capture pytest header in a file #10049

@tilusnet

Description

@tilusnet

pytest is nicely outputting a header like

==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0
rootdir: ..., configfile: pytest.ini
plugins: timeout-2.1.0, cov-2.12.1

<header ends>
collected 5 items 
....

I find it impossible to get this header into a file.

pytest 2>&1 > my_file.txt doesn't work either.
Why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questiongeneral question, might be closed after 2 weeks of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions