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

Method test_setmtime

testing/_py/test_local.py:735–750  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

733 f.close()
734
735 def test_setmtime(self):
736 import tempfile
737
738 fd, name = tempfile.mkstemp()
739 os.close(fd)
740 try:
741 # Do not use _pytest.timing here, as we do not want time mocking to affect this test.
742 mtime = int(time.time()) - 100
743 path = local(name)
744 assert path.mtime() != mtime
745 path.setmtime(mtime)
746 assert path.mtime() == mtime
747 path.setmtime()
748 assert path.mtime() != mtime
749 finally:
750 os.remove(name)
751
752 def test_normpath(self, path1):
753 new1 = path1.join("/otherdir")

Callers

nothing calls this directly

Calls 6

intClass · 0.85
timeMethod · 0.80
setmtimeMethod · 0.80
removeMethod · 0.80
closeMethod · 0.45
mtimeMethod · 0.45

Tested by

no test coverage detected