MCPcopy Create free account
hub / github.com/python/cpython / check_timestamp_agreement

Method check_timestamp_agreement

Lib/test/test_os/test_os.py:645–652  ·  view source on GitHub ↗
(self, result, names)

Source from the content-addressed store, hash-verified

643 create_file(self.fname, b"ABC")
644
645 def check_timestamp_agreement(self, result, names):
646 # Make sure that the st_?time and st_?time_ns fields roughly agree
647 # (they should always agree up to around tens-of-microseconds)
648 for name in names:
649 with self.subTest(name=name):
650 floaty = int(getattr(result, name) * 100_000)
651 nanosecondy = getattr(result, name + "_ns") // 10_000
652 self.assertAlmostEqual(floaty, nanosecondy, delta=2, msg=name)
653
654 def check_stat_attributes(self, fname):
655 result = os.stat(fname)

Callers 2

check_stat_attributesMethod · 0.95

Calls 2

subTestMethod · 0.45
assertAlmostEqualMethod · 0.45

Tested by

no test coverage detected