File tree 2 files changed +34
-28
lines changed
2 files changed +34
-28
lines changed Original file line number Diff line number Diff line change @@ -441,34 +441,6 @@ def test_timedelta(self, freq):
441
441
tm .assert_index_equal (result1 , result4 )
442
442
tm .assert_index_equal (result2 , result3 )
443
443
444
- def test_timedelta_nat_comparisons (self ):
445
- # GH 26039
446
- td = pd .Timedelta (0 )
447
-
448
- result = td > NaT
449
- assert result is False
450
-
451
- result = td >= NaT
452
- assert result is False
453
-
454
- result = td < NaT
455
- assert result is False
456
-
457
- result = td <= NaT
458
- assert result is False
459
-
460
- result = NaT > td
461
- assert result is False
462
-
463
- result = NaT >= td
464
- assert result is False
465
-
466
- result = NaT < td
467
- assert result is False
468
-
469
- result = NaT <= td
470
- assert result is False
471
-
472
444
473
445
class TestAddSubNaTMasking (object ):
474
446
# TODO: parametrize over boxes
Original file line number Diff line number Diff line change @@ -689,3 +689,37 @@ def test_rdivmod_invalid(self):
689
689
def test_td_op_timedelta_timedeltalike_array (self , op , arr ):
690
690
with pytest .raises (TypeError ):
691
691
op (arr , Timedelta ('1D' ))
692
+
693
+
694
+ class TestTimedeltaCompare ():
695
+ """
696
+ Tests for Timedelta comparisons.
697
+ """
698
+
699
+ def test_timedelta_nat_comparisons (self ):
700
+ # GH 26039
701
+ td = pd .Timedelta (0 )
702
+
703
+ result = td > NaT
704
+ assert result is False
705
+
706
+ result = td >= NaT
707
+ assert result is False
708
+
709
+ result = td < NaT
710
+ assert result is False
711
+
712
+ result = td <= NaT
713
+ assert result is False
714
+
715
+ result = NaT > td
716
+ assert result is False
717
+
718
+ result = NaT >= td
719
+ assert result is False
720
+
721
+ result = NaT < td
722
+ assert result is False
723
+
724
+ result = NaT <= td
725
+ assert result is False
You can’t perform that action at this time.
0 commit comments