1515from .common import str_to_checksum , test_each_database_in_list , TestPerDatabase
1616
1717
18- TEST_DATABASES = {db .MySQL , db .PostgreSQL , db .Oracle , db .Redshift , db .Snowflake , db .BigQuery }
18+ TEST_DATABASES = {
19+ db .MySQL ,
20+ db .PostgreSQL ,
21+ db .Oracle ,
22+ db .Redshift ,
23+ db .Snowflake ,
24+ db .BigQuery ,
25+ db .Presto ,
26+ db .Trino ,
27+ db .Vertica ,
28+ }
1929
2030test_each_database : Callable = test_each_database_in_list (TEST_DATABASES )
2131
@@ -383,9 +393,7 @@ def test_string_keys(self):
383393 diff = list (differ .diff_tables (self .a , self .b ))
384394 self .assertEqual (diff , [("-" , (str (self .new_uuid ), "This one is different" ))])
385395
386- self .connection .query (
387- self .src_table .insert_row ('unexpected' , '<-- this bad value should not break us' )
388- )
396+ self .connection .query (self .src_table .insert_row ("unexpected" , "<-- this bad value should not break us" ))
389397
390398 self .assertRaises (ValueError , list , differ .diff_tables (self .a , self .b ))
391399
@@ -421,7 +429,7 @@ def setUp(self):
421429 src_table .create (),
422430 src_table .insert_rows (values ),
423431 table (self .table_dst_path ).create (src_table ),
424- src_table .insert_row (self .new_alphanum , ' This one is different' ),
432+ src_table .insert_row (self .new_alphanum , " This one is different" ),
425433 commit ,
426434 ]
427435
@@ -491,7 +499,7 @@ def test_varying_alphanum_keys(self):
491499 self .assertEqual (diff , [("-" , (str (self .new_alphanum ), "This one is different" ))])
492500
493501 self .connection .query (
494- self .src_table .insert_row (' @@@' , ' <-- this bad value should not break us' ),
502+ self .src_table .insert_row (" @@@" , " <-- this bad value should not break us" ),
495503 commit ,
496504 )
497505
@@ -548,13 +556,15 @@ def setUp(self):
548556
549557 self .null_uuid = uuid .uuid1 (32132131 )
550558
551- self .connection .query ([
552- src_table .create (),
553- src_table .insert_rows (values ),
554- table (self .table_dst_path ).create (src_table ),
555- src_table .insert_row (self .null_uuid , None ),
556- commit ,
557- ])
559+ self .connection .query (
560+ [
561+ src_table .create (),
562+ src_table .insert_rows (values ),
563+ table (self .table_dst_path ).create (src_table ),
564+ src_table .insert_row (self .null_uuid , None ),
565+ commit ,
566+ ]
567+ )
558568
559569 self .a = _table_segment (self .connection , self .table_src_path , "id" , "text_comment" , case_sensitive = False )
560570 self .b = _table_segment (self .connection , self .table_dst_path , "id" , "text_comment" , case_sensitive = False )
@@ -576,9 +586,9 @@ def setUp(self):
576586 self .connection .query (
577587 [
578588 src_table .create (),
579- src_table .insert_row (uuid .uuid1 (1 ), '1' ),
589+ src_table .insert_row (uuid .uuid1 (1 ), "1" ),
580590 table (self .table_dst_path ).create (src_table ),
581- src_table .insert_row (self .null_uuid , None ), # Add a row where a column has NULL value
591+ src_table .insert_row (self .null_uuid , None ), # Add a row where a column has NULL value
582592 commit ,
583593 ]
584594 )
@@ -685,24 +695,28 @@ class TestTableTableEmpty(TestPerDatabase):
685695 def setUp (self ):
686696 super ().setUp ()
687697
688- self .src_table = src_table = table (self .table_src_path , schema = {"id" : str , "text_comment" : str })
689- self .dst_table = dst_table = table (self .table_dst_path , schema = {"id" : str , "text_comment" : str })
698+ self .src_table = table (self .table_src_path , schema = {"id" : str , "text_comment" : str })
699+ self .dst_table = table (self .table_dst_path , schema = {"id" : str , "text_comment" : str })
690700
691701 self .null_uuid = uuid .uuid1 (1 )
692702
693703 self .diffs = [(uuid .uuid1 (i ), str (i )) for i in range (100 )]
694704
695- self .connection .query ([src_table .create (), dst_table .create (), src_table .insert_rows (self .diffs ), commit ])
696-
697705 self .a = _table_segment (self .connection , self .table_src_path , "id" , "text_comment" , case_sensitive = False )
698706 self .b = _table_segment (self .connection , self .table_dst_path , "id" , "text_comment" , case_sensitive = False )
699707
700708 def test_right_table_empty (self ):
709+ self .connection .query (
710+ [self .src_table .create (), self .dst_table .create (), self .src_table .insert_rows (self .diffs ), commit ]
711+ )
712+
701713 differ = HashDiffer ()
702714 self .assertRaises (ValueError , list , differ .diff_tables (self .a , self .b ))
703715
704716 def test_left_table_empty (self ):
705- self .connection .query ([self .dst_table .insert_expr (self .src_table ), self .src_table .truncate (), commit ])
717+ self .connection .query (
718+ [self .src_table .create (), self .dst_table .create (), self .dst_table .insert_rows (self .diffs ), commit ]
719+ )
706720
707721 differ = HashDiffer ()
708722 self .assertRaises (ValueError , list , differ .diff_tables (self .a , self .b ))
0 commit comments