MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_timestamp_in_xml

Method test_timestamp_in_xml

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

Source from the content-addressed store, hash-verified

211
212 @parametrize_families
213 def test_timestamp_in_xml(
214 self, pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str
215 ) -> None:
216 pytester.makepyfile(
217 """
218 def test_pass():
219 pass
220 """
221 )
222 start_time = datetime.now()
223 result, dom = run_and_parse(family=xunit_family)
224 node = dom.find_first_by_tag("testsuite")
225 timestamp = datetime.strptime(node["timestamp"], "%Y-%m-%dT%H:%M:%S.%f")
226 assert start_time <= timestamp < datetime.now()
227
228 def test_timing_function(
229 self, pytester: Pytester, run_and_parse: RunAndParse, mock_timing

Callers

nothing calls this directly

Calls 3

run_and_parseFunction · 0.85
find_first_by_tagMethod · 0.80
makepyfileMethod · 0.45

Tested by

no test coverage detected