MCPcopy
hub / github.com/pytest-dev/pytest / test_timestamp_in_xml

Method test_timestamp_in_xml

testing/test_junitxml.py:278–291  ·  view source on GitHub ↗
(
        self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
    )

Source from the content-addressed store, hash-verified

276
277 @parametrize_families
278 def test_timestamp_in_xml(
279 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
280 ) -> None:
281 pytester.makepyfile(
282 """
283 def test_pass():
284 pass
285 """
286 )
287 start_time = datetime.now(timezone.utc)
288 _result, dom = run_and_parse(family=xunit_family)
289 node = dom.get_first_by_tag("testsuite")
290 timestamp = datetime.fromisoformat(node["timestamp"])
291 assert start_time <= timestamp < datetime.now(timezone.utc)
292
293 def test_timing_function(
294 self,

Callers

nothing calls this directly

Calls 3

run_and_parseFunction · 0.85
get_first_by_tagMethod · 0.80
makepyfileMethod · 0.45

Tested by

no test coverage detected