Skip to content

Timestamp in Pytest JUnit XML test report doesn't have time zone infomation #7662

@jih-dk

Description

@jih-dk
  • a detailed description of the bug or suggestion
    Last year, pytest add attribute to the JUnit test report. In the test report I can see the timestamp like
    timestamp="2020-08-17T10:14:39.548365"

It looks like pytest just takes the system time from OS, and save it to test report.
Unfortunately, this timestamp doesn't have any timezone infomation, Our CI system will treat this timestamp as a UTC time, even the timestamp is actually from another time zone.

  • pytest and operating system versions
    pytest 5.2.1, I have seen the issue in both Linux and Windows

Is it possible to add timezone information to the timestamp attribute, or always use UTC time in timestamp?

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: junitxmlrelated to the junitxml builtin plugintype: 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