File tree 1 file changed +5
-10
lines changed
1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -1489,20 +1489,15 @@ def test_read_procedure(self):
1489
1489
SELECT * FROM test_procedure;
1490
1490
END"""
1491
1491
1492
- connection = self .conn .connect ()
1493
- trans = connection .begin ()
1494
- try :
1495
- r1 = connection .execute (proc )
1496
- trans .commit ()
1497
- except :
1498
- trans .rollback ()
1499
- raise
1492
+ with self .conn .connect () as connection :
1493
+ with connection .begin ():
1494
+ connection .execute (proc ).close ()
1500
1495
1501
- res1 = sql .read_sql_query ("CALL get_testdb(); " , self .conn )
1496
+ res1 = sql .read_sql_query ("CALL get_testdb()" , self .conn )
1502
1497
tm .assert_frame_equal (df , res1 )
1503
1498
1504
1499
# test delegation to read_sql_query
1505
- res2 = sql .read_sql ("CALL get_testdb(); " , self .conn )
1500
+ res2 = sql .read_sql ("CALL get_testdb()" , self .conn )
1506
1501
tm .assert_frame_equal (df , res2 )
1507
1502
1508
1503
You can’t perform that action at this time.
0 commit comments