@@ -776,16 +776,16 @@ def test_qmark_paramstyle(self):
776776 def test_execute_parameters (self ):
777777 with self ._connect () as conn :
778778 cur = conn .cursor ()
779- all_chars = u "" .join (chr (i ) for i in range (1 , 128 ))
780- backslash_data = u "\\ backslash\\ \\ data\\ \\ "
779+ all_chars = "" .join (chr (i ) for i in range (1 , 128 ))
780+ backslash_data = "\\ backslash\\ \\ data\\ \\ "
781781 cur .execute ("SELECT :a, :b" , parameters = {"a" : all_chars , "b" : backslash_data })
782782 self .assertEqual ([all_chars , backslash_data ], cur .fetchone ())
783783
784784 def test_execute_percent_parameters (self ):
785785 with self ._connect () as conn :
786786 cur = conn .cursor ()
787- all_chars = u "" .join (chr (i ) for i in range (1 , 128 ))
788- backslash_data = u "\\ backslash\\ \\ data\\ \\ "
787+ all_chars = "" .join (chr (i ) for i in range (1 , 128 ))
788+ backslash_data = "\\ backslash\\ \\ data\\ \\ "
789789 cur .execute ("SELECT %s, %s" , parameters = [all_chars , backslash_data ])
790790 self .assertEqual ([all_chars , backslash_data ], cur .fetchone ())
791791
@@ -898,16 +898,16 @@ def test_copy_local_stdin_multistat(self):
898898
899899 # Check rejected files
900900 with open (rej1 , 'r' , encoding = 'utf-8' ) as f :
901- self .assertEqual (f .read (), u 'x\u00f1 ,bla\n ' )
901+ self .assertEqual (f .read (), 'x\u00f1 ,bla\n ' )
902902 with open (except1 , 'r' , encoding = 'utf-8' ) as f :
903903 content = f .read ()
904- self .assertTrue (u "Invalid integer format 'x\u00f1 ' for column 1 (a)" in content )
904+ self .assertTrue ("Invalid integer format 'x\u00f1 ' for column 1 (a)" in content )
905905 with open (rej2 , 'r' , encoding = 'utf-8' ) as f :
906- self .assertEqual (f .read (), u '10,kkkkkkkkkkkk\n xx,corge\n ' )
906+ self .assertEqual (f .read (), '10,kkkkkkkkkkkk\n xx,corge\n ' )
907907 with open (except2 , 'r' , encoding = 'utf-8' ) as f :
908908 content = f .read ()
909- self .assertTrue (u "The 12-byte value is too long for type Varchar(9), column 2 (b)" in content )
910- self .assertTrue (u "Invalid integer format 'xx' for column 1 (a)" in content )
909+ self .assertTrue ("The 12-byte value is too long for type Varchar(9), column 2 (b)" in content )
910+ self .assertTrue ("Invalid integer format 'xx' for column 1 (a)" in content )
911911
912912 # Delete data files
913913 try :
@@ -1004,18 +1004,18 @@ def test_copy_local_file_multistat(self, fetch_results):
10041004
10051005 # Check rejected files
10061006 with open (rej1 , 'r' , encoding = 'utf-8' ) as f :
1007- self .assertEqual (f .read (), u 'x\u00f1 ,bla\n 5,aaaaaaaaaa\n ' )
1007+ self .assertEqual (f .read (), 'x\u00f1 ,bla\n 5,aaaaaaaaaa\n ' )
10081008 with open (except1 , 'r' , encoding = 'utf-8' ) as f :
10091009 content = f .read ()
1010- self .assertTrue (u "Invalid integer format 'x\u00f1 ' for column 1 (a)" in content )
1011- self .assertTrue (u "The 10-byte value is too long for type Varchar(9), column 2 (b)" in content )
1010+ self .assertTrue ("Invalid integer format 'x\u00f1 ' for column 1 (a)" in content )
1011+ self .assertTrue ("The 10-byte value is too long for type Varchar(9), column 2 (b)" in content )
10121012 with open (rej2 , 'r' , encoding = 'utf-8' ) as f :
1013- self .assertEqual (f .read (), u '10,kkkkkkkkkkkk\n xx,corge\n f,quux\n ' )
1013+ self .assertEqual (f .read (), '10,kkkkkkkkkkkk\n xx,corge\n f,quux\n ' )
10141014 with open (except2 , 'r' , encoding = 'utf-8' ) as f :
10151015 content = f .read ()
1016- self .assertTrue (u "The 12-byte value is too long for type Varchar(9), column 2 (b)" in content )
1017- self .assertTrue (u "Invalid integer format 'xx' for column 1 (a)" in content )
1018- self .assertTrue (u "Invalid integer format 'f' for column 1 (a)" in content )
1016+ self .assertTrue ("The 12-byte value is too long for type Varchar(9), column 2 (b)" in content )
1017+ self .assertTrue ("Invalid integer format 'xx' for column 1 (a)" in content )
1018+ self .assertTrue ("Invalid integer format 'f' for column 1 (a)" in content )
10191019
10201020 # Delete files
10211021 try :
@@ -1059,7 +1059,7 @@ def test_copy_local_rejected_as_table(self):
10591059 cur .execute ("SELECT rejected_data, rejected_reason FROM test_loader_rejects ORDER BY row_number ASC" )
10601060 self .assertListOfListsEqual (cur .fetchall (),
10611061 [['5,aaaaaaaaaa' , 'The 10-byte value is too long for type Varchar(9), column 2 (b)' ],
1062- [u 'x\u00f1 ,bla' , u "Invalid integer format 'x\u00f1 ' for column 1 (a)" ]])
1062+ ['x\u00f1 ,bla' , "Invalid integer format 'x\u00f1 ' for column 1 (a)" ]])
10631063
10641064 cur .execute ("SELECT * FROM {0} ORDER BY a ASC" .format (self ._table ))
10651065 self .assertListOfListsEqual (cur .fetchall (), [[None , 'baz' ], [1 , 'foo' ], [2 , 'bar' ], [4 , None ]])
@@ -1141,7 +1141,7 @@ def test_executemany_quoted_path(self):
11411141 self ._test_executemany (table , [(1 , 'aa' ), (2 , 'bb' )])
11421142
11431143 def test_executemany_utf8 (self ):
1144- self ._test_executemany (self ._table , [(1 , u 'a\xfc ' ), (2 , u 'bb' )])
1144+ self ._test_executemany (self ._table , [(1 , 'a\xfc ' ), (2 , 'bb' )])
11451145
11461146 # test for #292
11471147 def test_executemany_autocommit (self ):
@@ -1283,8 +1283,8 @@ def test_named_paramstyle(self):
12831283 self .assertListOfListsEqual (res , [[1 , 'varchar' ]])
12841284
12851285 def test_executemany (self ):
1286- values = ((None , 'foo' ), [1 , 'aa' ], (2 , None ), [2 , u 'a\xfc ' ])
1287- expected = [[None , 'foo' ], [1 , 'aa' ], [2 , None ], [2 , u 'a\xfc ' ]]
1286+ values = ((None , 'foo' ), [1 , 'aa' ], (2 , None ), [2 , 'a\xfc ' ])
1287+ expected = [[None , 'foo' ], [1 , 'aa' ], [2 , None ], [2 , 'a\xfc ' ]]
12881288 with self ._connect () as conn :
12891289 cur = conn .cursor ()
12901290 cur .execute ("CREATE TABLE {} (a int, b varchar)" .format (self ._table ))
@@ -1312,7 +1312,7 @@ def test_executemany(self):
13121312 self .assertIsNone (cur .fetchone ())
13131313 self .assertTrue (cur .nextset ())
13141314
1315- self .assertListOfListsEqual (cur .fetchall (), [[2 , u 'a\xfc ' ], [2 , None ]])
1315+ self .assertListOfListsEqual (cur .fetchall (), [[2 , 'a\xfc ' ], [2 , None ]])
13161316 self .assertIsNone (cur .fetchone ())
13171317 self .assertTrue (cur .nextset ())
13181318
@@ -1353,8 +1353,8 @@ def test_bind_datetime(self):
13531353 self .assertListOfListsEqual (res , [values ])
13541354
13551355 def test_bind_binary (self ):
1356- values = [b'binary data' , b'\\ backslash data\\ ' , u '\\ backslash data\\ ' ,
1357- u '\u00f1 encoding' , 'raw data' , 'long varbinary data' , None ]
1356+ values = [b'binary data' , b'\\ backslash data\\ ' , '\\ backslash data\\ ' ,
1357+ '\u00f1 encoding' , 'raw data' , 'long varbinary data' , None ]
13581358 expected = [[b'binary data\x00 \x00 \x00 ' , b'\\ backslash data\\ ' ,
13591359 b'\\ backslash data\\ ' , b'\xc3 \xb1 encoding' ,
13601360 b'raw data' , b'long varbinary data' , None ]]
@@ -1398,9 +1398,9 @@ def test_bind_numeric(self):
13981398
13991399 def test_bind_character (self ):
14001400 values = ['char data' , b'raw varchar data' ,
1401- u 'long varbinary data \u00f1 ' , None , None , None ]
1401+ 'long varbinary data \u00f1 ' , None , None , None ]
14021402 expected = [['char data ' , 'raw varchar data' ,
1403- u 'long varbinary data \u00f1 ' , None , None , None ]]
1403+ 'long varbinary data \u00f1 ' , None , None , None ]]
14041404 with self ._connect () as conn :
14051405 cur = conn .cursor ()
14061406 cur .execute ("""CREATE TABLE {} (
0 commit comments