mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-11-04 09:47:30 +03:00 
			
		
		
		
	Unregister the composite array caster after the test
Otherwise the refcount script will report a leak.
This commit is contained in:
		
							parent
							
								
									0f4fd0d828
								
							
						
					
					
						commit
						6fc167a7b1
					
				| 
						 | 
				
			
			@ -596,7 +596,12 @@ class AdaptTypeTestCase(unittest.TestCase):
 | 
			
		|||
                curs2.execute("select (1,2)::type_ii")
 | 
			
		||||
                self.assertEqual(curs2.fetchone()[0], (1,2))
 | 
			
		||||
            finally:
 | 
			
		||||
                del psycopg2.extensions.string_types[t.oid]
 | 
			
		||||
                # drop the registered typecasters to help the refcounting
 | 
			
		||||
                # script to return precise values.
 | 
			
		||||
                del psycopg2.extensions.string_types[t.typecaster.values[0]]
 | 
			
		||||
                if t.array_typecaster:
 | 
			
		||||
                    del psycopg2.extensions.string_types[
 | 
			
		||||
                        t.array_typecaster.values[0]]
 | 
			
		||||
 | 
			
		||||
        finally:
 | 
			
		||||
            conn1.close()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user