# HG changeset patch # Parent 951552f602b261a088145c596695f5889b907926 diff -r 951552f602b2 Lib/test/test_os.py --- a/Lib/test/test_os.py Mon Jul 20 00:25:50 2015 -0400 +++ b/Lib/test/test_os.py Mon Jul 20 05:21:35 2015 +0000 @@ -433,11 +433,15 @@ with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) - old_state = os.stat_float_times(-1) - self.addCleanup(os.stat_float_times, old_state) - + self.old_float_times = os.stat_float_times(-1) os.stat_float_times(True) + def tearDown(self): + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + + os.stat_float_times(self.old_float_times) + def support_subsecond(self, filename): # Heuristic to check if the filesystem supports timestamp with # subsecond resolution: check if float and int timestamps are different