@@ -223,16 +223,16 @@ def test_repr(self):
223223 assert repr (ax ) == "Regular(4, 1.1, 2.2)"
224224
225225 ax = bh .axis .Regular (4 , 1.1 , 2.2 , metadata = "ra" )
226- assert repr (ax ) == "Regular(4, 1.1, 2.2)"
226+ assert repr (ax ) == "Regular(4, 1.1, 2.2, metadata='ra' )"
227227
228228 ax = bh .axis .Regular (4 , 1.1 , 2.2 , underflow = False )
229229 assert repr (ax ) == "Regular(4, 1.1, 2.2, underflow=False)"
230230
231231 ax = bh .axis .Regular (4 , 1.1 , 2.2 , metadata = "ra" , overflow = False )
232- assert repr (ax ) == "Regular(4, 1.1, 2.2, overflow=False)"
232+ assert repr (ax ) == "Regular(4, 1.1, 2.2, overflow=False, metadata='ra' )"
233233
234234 ax = bh .axis .Regular (4 , 1.1 , 2.2 , metadata = "ra" , circular = True )
235- assert repr (ax ) == "Regular(4, 1.1, 2.2, circular=True)"
235+ assert repr (ax ) == "Regular(4, 1.1, 2.2, circular=True, metadata='ra' )"
236236
237237 ax = bh .axis .Regular (4 , 1.1 , 2.2 , transform = bh .axis .transform .log )
238238 assert repr (ax ) == "Regular(4, 1.1, 2.2, transform=log)"
@@ -407,7 +407,7 @@ def test_repr(self):
407407 assert repr (ax ) == "Regular(4, 1.1, 2.2, circular=True)"
408408
409409 ax = bh .axis .Regular (4 , 1.1 , 2.2 , metadata = "hi" , circular = True )
410- assert repr (ax ) == "Regular(4, 1.1, 2.2, circular=True)"
410+ assert repr (ax ) == "Regular(4, 1.1, 2.2, circular=True, metadata='hi' )"
411411
412412 def test_getitem (self ):
413413 a = bh .axis .Regular (2 , 1 , 1 + np .pi * 2 , circular = True )
@@ -520,7 +520,7 @@ def test_repr(self):
520520 assert repr (a ) == "Variable([-0.1, 0.2])"
521521
522522 a = bh .axis .Variable ([- 0.1 , 0.2 ], metadata = "hi" )
523- assert repr (a ) == "Variable([-0.1, 0.2])"
523+ assert repr (a ) == "Variable([-0.1, 0.2], metadata='hi' )"
524524
525525 def test_getitem (self ):
526526 ref = [- 0.1 , 0.2 , 0.3 ]
@@ -639,7 +639,10 @@ def test_repr(self):
639639 assert repr (a ) == "Integer(-1, 1)"
640640
641641 a = bh .axis .Integer (- 1 , 1 , metadata = "hi" )
642- assert repr (a ) == "Integer(-1, 1)"
642+ assert repr (a ) == "Integer(-1, 1, metadata='hi')"
643+
644+ a = bh .axis .Integer (- 1 , 1 , metadata = 2 )
645+ assert repr (a ) == "Integer(-1, 1, metadata=...)"
643646
644647 a = bh .axis .Integer (- 1 , 1 , underflow = False )
645648 assert repr (a ) == "Integer(-1, 1, underflow=False)"
@@ -763,14 +766,14 @@ def test_repr(self):
763766 assert repr (ax ) == "IntCategory([1, 2, 3])"
764767
765768 ax = bh .axis .IntCategory ([1 , 2 , 3 ], metadata = "foo" )
766- assert repr (ax ) == "IntCategory([1, 2, 3])"
769+ assert repr (ax ) == "IntCategory([1, 2, 3], metadata='foo' )"
767770
768771 ax = bh .axis .StrCategory ("ABC" , metadata = "foo" )
769772 # If unicode is the default (Python 3, generally)
770773 if type ("" ) == type (u"" ): # noqa: E721
771- assert repr (ax ) == "StrCategory(['A', 'B', 'C'])"
774+ assert repr (ax ) == "StrCategory(['A', 'B', 'C'], metadata='foo' )"
772775 else :
773- assert repr (ax ) == "StrCategory([u'A', u'B', u'C'])"
776+ assert repr (ax ) == "StrCategory([u'A', u'B', u'C'], metadata='foo' )"
774777
775778 @pytest .mark .parametrize ("ref" , ([1 , 2 , 3 ], "ABC" ))
776779 def test_getitem (self , ref , growth ):
@@ -868,7 +871,7 @@ def test_repr(self):
868871 assert repr (a ) == "Boolean()"
869872
870873 a = bh .axis .Boolean (metadata = "hi" )
871- assert repr (a ) == "Boolean()"
874+ assert repr (a ) == "Boolean(, metadata='hi' )"
872875
873876 def test_label (self ):
874877 a = bh .axis .Boolean (metadata = "foo" )
0 commit comments