summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_datetime.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-12-05 20:28:34 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-12-05 20:28:34 (GMT)
commit5c2db37c20ad62097ffaaea32c7e332484c200e0 (patch)
tree9f88385ce641ffaa2587693bd38bc1d0f2cfb674 /Lib/test/test_datetime.py
parentc39aad7c278135e599489914e74cf939e39953e9 (diff)
downloadcpython-5c2db37c20ad62097ffaaea32c7e332484c200e0.zip
cpython-5c2db37c20ad62097ffaaea32c7e332484c200e0.tar.gz
cpython-5c2db37c20ad62097ffaaea32c7e332484c200e0.tar.bz2
Issue #7435: Remove duplicate int/long tests, and other
references to long in py3k. Patch provided by flox.
Diffstat (limited to 'Lib/test/test_datetime.py')
-rw-r--r--Lib/test/test_datetime.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py
index d85217d..8714b16 100644
--- a/Lib/test/test_datetime.py
+++ b/Lib/test/test_datetime.py
@@ -22,7 +22,7 @@ assert len(pickle_choices) == 3
# An arbitrary collection of objects of non-datetime types, for testing
# mixed-type comparisons.
-OTHERSTUFF = (10, 10, 34.5, "abc", {}, [], ())
+OTHERSTUFF = (10, 34.5, "abc", {}, [], ())
#############################################################################
@@ -232,8 +232,8 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
def test_disallowed_computations(self):
a = timedelta(42)
- # Add/sub ints, longs, floats should be illegal
- for i in 1, 1, 1.0:
+ # Add/sub ints or floats should be illegal
+ for i in 1, 1.0:
self.assertRaises(TypeError, lambda: a+i)
self.assertRaises(TypeError, lambda: a-i)
self.assertRaises(TypeError, lambda: i+a)
@@ -250,9 +250,9 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
# Division of int by timedelta doesn't make sense.
# Division by zero doesn't make sense.
- for zero in 0, 0:
- self.assertRaises(TypeError, lambda: zero // a)
- self.assertRaises(ZeroDivisionError, lambda: a // zero)
+ zero = 0
+ self.assertRaises(TypeError, lambda: zero // a)
+ self.assertRaises(ZeroDivisionError, lambda: a // zero)
def test_basic_attributes(self):
days, seconds, us = 1, 7, 31
@@ -685,8 +685,8 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
self.assertEqual(a - (a - week), week)
self.assertEqual(a - (a - day), day)
- # Add/sub ints, longs, floats should be illegal
- for i in 1, 1, 1.0:
+ # Add/sub ints or floats should be illegal
+ for i in 1, 1.0:
self.assertRaises(TypeError, lambda: a+i)
self.assertRaises(TypeError, lambda: a-i)
self.assertRaises(TypeError, lambda: i+a)
@@ -1376,8 +1376,8 @@ class TestDateTime(TestDate):
self.theclass(2002, 2, 22, 16, 5, 59, 999000))
self.assertEqual(a - (week + day + hour + millisec),
(((a - week) - day) - hour) - millisec)
- # Add/sub ints, longs, floats should be illegal
- for i in 1, 1, 1.0:
+ # Add/sub ints or floats should be illegal
+ for i in 1, 1.0:
self.assertRaises(TypeError, lambda: a+i)
self.assertRaises(TypeError, lambda: a-i)
self.assertRaises(TypeError, lambda: i+a)