diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-07-20 15:13:28 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-07-20 15:13:28 (GMT) |
| commit | fd44384f33ebe0fe4e26289c2f0a0d705624aa15 (patch) | |
| tree | 25c5e1dec1b2fb9a84f897de6dc03764aae07ad0 /Lib/test/test_os.py | |
| parent | ff9e18a863aa9f7efd894f660d413cd02ccb1834 (diff) | |
| parent | 3d0b8422bcbed2c06394ac7dfc9e7cbfe910b220 (diff) | |
| download | cpython-fd44384f33ebe0fe4e26289c2f0a0d705624aa15.zip cpython-fd44384f33ebe0fe4e26289c2f0a0d705624aa15.tar.gz cpython-fd44384f33ebe0fe4e26289c2f0a0d705624aa15.tar.bz2 | |
Merge 3.5
Diffstat (limited to 'Lib/test/test_os.py')
| -rw-r--r-- | Lib/test/test_os.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index fd8269d..26baca9 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -429,12 +429,18 @@ class UtimeTests(unittest.TestCase): with open(self.fname, 'wb') as fp: fp.write(b"ABC") + def restore_float_times(state): + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + + os.stat_float_times(state) + # ensure that st_atime and st_mtime are float with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) - old_state = os.stat_float_times(-1) - self.addCleanup(os.stat_float_times, old_state) + old_float_times = os.stat_float_times(-1) + self.addCleanup(restore_float_times, old_float_times) os.stat_float_times(True) |
