@@ -8,12 +8,14 @@ def test_list(self):
88 assert Bit ([True , False , True ]).to_list () == [True , False , True ]
99
1010 def test_list_none (self ):
11- with pytest .warns (UserWarning , match = 'expected elements to be boolean' ):
12- assert Bit ([True , None , True ]).to_text () == '101' # ty: ignore[invalid-argument-type]
11+ with pytest .raises (ValueError ) as error :
12+ Bit ([True , None , True ]) # ty: ignore[invalid-argument-type]
13+ assert str (error .value ) == 'expected list[bool]'
1314
1415 def test_list_int (self ):
15- with pytest .warns (UserWarning , match = 'expected elements to be boolean' ):
16- assert Bit ([254 , 7 , 0 ]).to_text () == '110' # ty: ignore[invalid-argument-type]
16+ with pytest .raises (ValueError ) as error :
17+ Bit ([254 , 7 , 0 ]) # ty: ignore[invalid-argument-type]
18+ assert str (error .value ) == 'expected list[bool]'
1719
1820 def test_str (self ):
1921 assert Bit ('101' ).to_list () == [True , False , True ]
@@ -49,12 +51,12 @@ def test_ndarray_uint16(self):
4951 def test_ndim_two (self ):
5052 with pytest .raises (ValueError ) as error :
5153 Bit ([[True , False ], [True , False ]]) # ty: ignore[invalid-argument-type]
52- assert str (error .value ) == 'expected ndim to be 1 '
54+ assert str (error .value ) == 'expected list[bool] '
5355
5456 def test_ndim_zero (self ):
5557 with pytest .raises (ValueError ) as error :
5658 Bit (True ) # ty: ignore[invalid-argument-type]
57- assert str (error .value ) == 'expected ndim to be 1 '
59+ assert str (error .value ) == 'expected bytes, str, list, or ndarray '
5860
5961 def test_repr (self ):
6062 assert repr (Bit ([True , False , True ])) == 'Bit(101)'
0 commit comments