@@ -564,11 +564,10 @@ def setup_method(self, method):
564564 self .offset2 = BDay (2 )
565565
566566 def test_different_normalize_equals (self ):
567- # equivalent in this special case
568- offset = BDay ()
569- offset2 = BDay ()
570- offset2 .normalize = True
571- assert offset == offset2
567+ # GH#21404 changed __eq__ to return False when `normalize` doesnt match
568+ offset = self ._offset ()
569+ offset2 = self ._offset (normalize = True )
570+ assert offset != offset2
572571
573572 def test_repr (self ):
574573 assert repr (self .offset ) == '<BusinessDay>'
@@ -734,11 +733,10 @@ def test_constructor_errors(self):
734733 BusinessHour (start = '14:00:05' )
735734
736735 def test_different_normalize_equals (self ):
737- # equivalent in this special case
736+ # GH#21404 changed __eq__ to return False when `normalize` doesnt match
738737 offset = self ._offset ()
739- offset2 = self ._offset ()
740- offset2 .normalize = True
741- assert offset == offset2
738+ offset2 = self ._offset (normalize = True )
739+ assert offset != offset2
742740
743741 def test_repr (self ):
744742 assert repr (self .offset1 ) == '<BusinessHour: BH=09:00-17:00>'
@@ -1397,11 +1395,10 @@ def test_constructor_errors(self):
13971395 CustomBusinessHour (start = '14:00:05' )
13981396
13991397 def test_different_normalize_equals (self ):
1400- # equivalent in this special case
1398+ # GH#21404 changed __eq__ to return False when `normalize` doesnt match
14011399 offset = self ._offset ()
1402- offset2 = self ._offset ()
1403- offset2 .normalize = True
1404- assert offset == offset2
1400+ offset2 = self ._offset (normalize = True )
1401+ assert offset != offset2
14051402
14061403 def test_repr (self ):
14071404 assert repr (self .offset1 ) == '<CustomBusinessHour: CBH=09:00-17:00>'
@@ -1627,11 +1624,10 @@ def setup_method(self, method):
16271624 self .offset2 = CDay (2 )
16281625
16291626 def test_different_normalize_equals (self ):
1630- # equivalent in this special case
1631- offset = CDay ()
1632- offset2 = CDay ()
1633- offset2 .normalize = True
1634- assert offset == offset2
1627+ # GH#21404 changed __eq__ to return False when `normalize` doesnt match
1628+ offset = self ._offset ()
1629+ offset2 = self ._offset (normalize = True )
1630+ assert offset != offset2
16351631
16361632 def test_repr (self ):
16371633 assert repr (self .offset ) == '<CustomBusinessDay>'
@@ -1865,11 +1861,10 @@ class TestCustomBusinessMonthEnd(CustomBusinessMonthBase, Base):
18651861 _offset = CBMonthEnd
18661862
18671863 def test_different_normalize_equals (self ):
1868- # equivalent in this special case
1869- offset = CBMonthEnd ()
1870- offset2 = CBMonthEnd ()
1871- offset2 .normalize = True
1872- assert offset == offset2
1864+ # GH#21404 changed __eq__ to return False when `normalize` doesnt match
1865+ offset = self ._offset ()
1866+ offset2 = self ._offset (normalize = True )
1867+ assert offset != offset2
18731868
18741869 def test_repr (self ):
18751870 assert repr (self .offset ) == '<CustomBusinessMonthEnd>'
@@ -1982,11 +1977,10 @@ class TestCustomBusinessMonthBegin(CustomBusinessMonthBase, Base):
19821977 _offset = CBMonthBegin
19831978
19841979 def test_different_normalize_equals (self ):
1985- # equivalent in this special case
1986- offset = CBMonthBegin ()
1987- offset2 = CBMonthBegin ()
1988- offset2 .normalize = True
1989- assert offset == offset2
1980+ # GH#21404 changed __eq__ to return False when `normalize` doesnt match
1981+ offset = self ._offset ()
1982+ offset2 = self ._offset (normalize = True )
1983+ assert offset != offset2
19901984
19911985 def test_repr (self ):
19921986 assert repr (self .offset ) == '<CustomBusinessMonthBegin>'
0 commit comments