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

Method test_atime

testing/_py/test_local.py:1400–1414  ·  testing/_py/test_local.py::TestPOSIXLocalPath.test_atime
(self, tmpdir)

Source from the content-addressed store, hash-verified

1398 assert res is None
1399
1400 def test_atime(self, tmpdir):
1401 import time
1402
1403 path = tmpdir.ensure(class="st">"samplefile")
1404 class="cm"># Do not use _pytest.timing here, as we do not want time mocking to affect this test.
1405 now = time.time()
1406 atime1 = path.atime()
1407 class="cm"># we could wait here but timer resolution is very
1408 class="cm"># system dependent
1409 path.read_binary()
1410 time.sleep(ATIME_RESOLUTION)
1411 atime2 = path.atime()
1412 time.sleep(ATIME_RESOLUTION)
1413 duration = time.time() - now
1414 assert (atime2 - atime1) <= duration
1415
1416 def test_commondir(self, path1):
1417 class="cm"># XXX This is here in local until we find a way to implement this

Callers

nothing calls this directly

Calls 5

ensureMethod · 0.80
timeMethod · 0.80
atimeMethod · 0.80
read_binaryMethod · 0.80
sleepMethod · 0.80

Tested by

no test coverage detected