diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-06-12 20:46:37 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-06-12 20:46:37 (GMT) |
commit | 2b89fdf7eb17b5ca3928aa3c2f6552e79386c677 (patch) | |
tree | 644b67cd605fd28d1b8d676b79787cf03fd4d3df /Lib/test/test_time.py | |
parent | bda4b8802c9693cd1c6f97cc09e34c4f63b030ef (diff) | |
download | cpython-2b89fdf7eb17b5ca3928aa3c2f6552e79386c677.zip cpython-2b89fdf7eb17b5ca3928aa3c2f6552e79386c677.tar.gz cpython-2b89fdf7eb17b5ca3928aa3c2f6552e79386c677.tar.bz2 |
PEP 418: Rename adjusted attribute to adjustable in time.get_clock_info() result
Fix also its value on Windows and Linux according to its documentation:
"adjustable" indicates if the clock *can be* adjusted, not if it is or was
adjusted.
In most cases, it is not possible to indicate if a clock is or was adjusted.
Diffstat (limited to 'Lib/test/test_time.py')
-rw-r--r-- | Lib/test/test_time.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 02f05c3..bd72af5 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -32,14 +32,14 @@ class TimeTestCase(unittest.TestCase): info = time.get_clock_info('time') self.assertFalse(info.monotonic) if sys.platform != 'win32': - self.assertTrue(info.adjusted) + self.assertTrue(info.adjustable) def test_clock(self): time.clock() info = time.get_clock_info('clock') self.assertTrue(info.monotonic) - self.assertFalse(info.adjusted) + self.assertFalse(info.adjustable) @unittest.skipUnless(hasattr(time, 'clock_gettime'), 'need time.clock_gettime()') @@ -372,9 +372,9 @@ class TimeTestCase(unittest.TestCase): info = time.get_clock_info('monotonic') self.assertTrue(info.monotonic) if sys.platform == 'linux': - self.assertTrue(info.adjusted) + self.assertTrue(info.adjustable) else: - self.assertFalse(info.adjusted) + self.assertFalse(info.adjustable) def test_perf_counter(self): time.perf_counter() @@ -390,7 +390,7 @@ class TimeTestCase(unittest.TestCase): info = time.get_clock_info('process_time') self.assertTrue(info.monotonic) - self.assertFalse(info.adjusted) + self.assertFalse(info.adjustable) @unittest.skipUnless(hasattr(time, 'monotonic'), 'need time.monotonic') @@ -441,7 +441,7 @@ class TimeTestCase(unittest.TestCase): # 0.0 < resolution <= 1.0 self.assertGreater(info.resolution, 0.0) self.assertLessEqual(info.resolution, 1.0) - self.assertIsInstance(info.adjusted, bool) + self.assertIsInstance(info.adjustable, bool) self.assertRaises(ValueError, time.get_clock_info, 'xxx') |