]> granicus.if.org Git - python/commitdiff
Issue #7879: Skip negative timestamps test on any Windows platform
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>
Wed, 26 May 2010 20:45:37 +0000 (20:45 +0000)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>
Wed, 26 May 2010 20:45:37 +0000 (20:45 +0000)
using unittest.skipIf decorator.

Lib/test/test_datetime.py

index f9bb464774b0ca768cf00c452fb4a993d7baca49..671c259a3ace4480180eeb5d6d162c7e89e165d5 100644 (file)
@@ -1510,19 +1510,14 @@ class TestDateTime(TestDate):
         for insane in -1e200, 1e200:
             self.assertRaises(ValueError, self.theclass.utcfromtimestamp,
                               insane)
-
+    @unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
     def test_negative_float_fromtimestamp(self):
-        # Windows doesn't accept negative timestamps
-        if sys.platform == "win32":
-            return
         # The result is tz-dependent; at least test that this doesn't
         # fail (like it did before bug 1646728 was fixed).
         self.theclass.fromtimestamp(-1.05)
 
+    @unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
     def test_negative_float_utcfromtimestamp(self):
-        # Windows doesn't accept negative timestamps
-        if sys.platform == "win32":
-            return
         d = self.theclass.utcfromtimestamp(-1.05)
         self.assertEquals(d, self.theclass(1969, 12, 31, 23, 59, 58, 950000))