mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-43853: Handle sqlite3_value_text() errors (GH-25422)
This commit is contained in:
		
							parent
							
								
									8363ac8607
								
							
						
					
					
						commit
						006fd869e4
					
				
					 3 changed files with 21 additions and 13 deletions
				
			
		|  | @ -236,9 +236,11 @@ def test_func_exception(self): | |||
| 
 | ||||
|     def test_param_string(self): | ||||
|         cur = self.con.cursor() | ||||
|         cur.execute("select isstring(?)", ("foo",)) | ||||
|         val = cur.fetchone()[0] | ||||
|         self.assertEqual(val, 1) | ||||
|         for text in ["foo", str()]: | ||||
|             with self.subTest(text=text): | ||||
|                 cur.execute("select isstring(?)", (text,)) | ||||
|                 val = cur.fetchone()[0] | ||||
|                 self.assertEqual(val, 1) | ||||
| 
 | ||||
|     def test_param_int(self): | ||||
|         cur = self.con.cursor() | ||||
|  | @ -391,9 +393,9 @@ def test_aggr_exception_in_finalize(self): | |||
| 
 | ||||
|     def test_aggr_check_param_str(self): | ||||
|         cur = self.con.cursor() | ||||
|         cur.execute("select checkType('str', ?)", ("foo",)) | ||||
|         cur.execute("select checkTypes('str', ?, ?)", ("foo", str())) | ||||
|         val = cur.fetchone()[0] | ||||
|         self.assertEqual(val, 1) | ||||
|         self.assertEqual(val, 2) | ||||
| 
 | ||||
|     def test_aggr_check_param_int(self): | ||||
|         cur = self.con.cursor() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Erlend Egeberg Aasland
						Erlend Egeberg Aasland