mirror of
				https://github.com/psycopg/psycopg2.git
				synced 2025-11-04 09:47:30 +03:00 
			
		
		
		
	Merge pull request #1105 from rafiss/with-block-connection-test
Handle failure in setup of ConnectionTwoPhaseTest
This commit is contained in:
		
						commit
						779a1370ce
					
				| 
						 | 
					@ -913,9 +913,11 @@ class ConnectionTwoPhaseTests(ConnectingTestCase):
 | 
				
			||||||
            cur.execute("DROP TABLE test_tpc;")
 | 
					            cur.execute("DROP TABLE test_tpc;")
 | 
				
			||||||
        except psycopg2.ProgrammingError:
 | 
					        except psycopg2.ProgrammingError:
 | 
				
			||||||
            cnn.rollback()
 | 
					            cnn.rollback()
 | 
				
			||||||
        cur.execute("CREATE TABLE test_tpc (data text);")
 | 
					        try:
 | 
				
			||||||
        cnn.commit()
 | 
					            cur.execute("CREATE TABLE test_tpc (data text);")
 | 
				
			||||||
        cnn.close()
 | 
					            cnn.commit()
 | 
				
			||||||
 | 
					        finally:
 | 
				
			||||||
 | 
					            cnn.close()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def count_xacts(self):
 | 
					    def count_xacts(self):
 | 
				
			||||||
        """Return the number of prepared xacts currently in the test db."""
 | 
					        """Return the number of prepared xacts currently in the test db."""
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user