@@ -30,33 +30,6 @@ def assert_raises_on_comparison(self, cell, other, exception_type, regexp):
3030 with self .assertRaisesRegex (exception_type , regexp ):
3131 cell >= other
3232
33- def test_cftime_cell (self ):
34- # Check that cell comparison when the cell contains
35- # cftime.datetime objects raises an exception otherwise
36- # this will fall back to id comparison producing unreliable
37- # results.
38- cell = Cell (cftime .datetime (2010 , 3 , 21 ))
39- dt = mock .Mock (timetuple = mock .Mock ())
40- self .assert_raises_on_comparison (
41- cell , dt , TypeError , "determine the order of cftime"
42- )
43- self .assert_raises_on_comparison (
44- cell , 23 , TypeError , "determine the order of cftime"
45- )
46- self .assert_raises_on_comparison (
47- cell , "hello" , TypeError , "Unexpected type.*str"
48- )
49-
50- def test_cftime_other (self ):
51- # Check that cell comparison to a cftime.datetime object
52- # raises an exception otherwise this will fall back to id comparison
53- # producing unreliable results.
54- dt = cftime .datetime (2010 , 3 , 21 )
55- cell = Cell (mock .Mock (timetuple = mock .Mock ()))
56- self .assert_raises_on_comparison (
57- cell , dt , TypeError , "determine the order of cftime"
58- )
59-
6033 def test_PartialDateTime_bounded_cell (self ):
6134 # Check that bounded comparisions to a PartialDateTime
6235 # raise an exception. These are not supported as they
@@ -85,10 +58,9 @@ def test_PartialDateTime_unbounded_cell(self):
8558 def test_datetime_unbounded_cell (self ):
8659 # Check that cell comparison works with datetimes.
8760 dt = datetime .datetime (2000 , 6 , 15 )
88- cell = Cell (datetime .datetime (2000 , 1 , 1 ))
89- # Note the absence of the inverse of these
90- # e.g. self.assertGreater(dt, cell).
91- # See http://bugs.python.org/issue8005
61+ cell = Cell (cftime .datetime (2000 , 1 , 1 ))
62+ self .assertGreater (dt , cell )
63+ self .assertGreaterEqual (dt , cell )
9264 self .assertLess (cell , dt )
9365 self .assertLessEqual (cell , dt )
9466
0 commit comments