@@ -25,6 +25,8 @@ class TestTypeAliasPatterns:
2525 ("uint16" , "UINT16" ),
2626 ("int8" , "INT8" ),
2727 ("uint8" , "UINT8" ),
28+ ("bool" , "BOOL" ),
29+ ("boolean" , "BOOL" ),
2830 ],
2931 )
3032 def test_type_alias_pattern_matching (self , alias , expected_category ):
@@ -47,6 +49,8 @@ def test_type_alias_pattern_matching(self, alias, expected_category):
4749 ("uint16" , "smallint unsigned" ),
4850 ("int8" , "tinyint" ),
4951 ("uint8" , "tinyint unsigned" ),
52+ ("bool" , "tinyint" ),
53+ ("boolean" , "tinyint" ),
5054 ],
5155 )
5256 def test_type_alias_mysql_mapping (self , alias , expected_mysql_type ):
@@ -107,6 +111,7 @@ def test_heading_preserves_type_aliases(self, schema_type_aliases):
107111 assert "uint16" in heading_str
108112 assert "int8" in heading_str
109113 assert "uint8" in heading_str
114+ assert "bool" in heading_str
110115
111116
112117class TestTypeAliasInsertFetch :
@@ -129,6 +134,7 @@ def test_insert_and_fetch(self, schema_type_aliases):
129134 val_uint16 = 65535 , # max uint16
130135 val_int8 = 127 , # max int8
131136 val_uint8 = 255 , # max uint8
137+ val_bool = 1 , # boolean true
132138 )
133139
134140 table .insert1 (test_data )
@@ -145,6 +151,7 @@ def test_insert_and_fetch(self, schema_type_aliases):
145151 assert fetched ["val_uint16" ] == test_data ["val_uint16" ]
146152 assert fetched ["val_int8" ] == test_data ["val_int8" ]
147153 assert fetched ["val_uint8" ] == test_data ["val_uint8" ]
154+ assert fetched ["val_bool" ] == test_data ["val_bool" ]
148155
149156 def test_insert_primary_key_with_aliases (self , schema_type_aliases ):
150157 """Test using type aliases in primary key."""
0 commit comments