| 227 | is_(c1, r1.driver_connection) |
| 228 | |
| 229 | def test_rec_close_reopen(self): |
| 230 | # test that _ConnectionRecord.close() allows |
| 231 | # the record to be reusable |
| 232 | dbapi = MockDBAPI() |
| 233 | p1 = pool.Pool(creator=lambda: dbapi.connect("foo.db")) |
| 234 | |
| 235 | r1 = pool._ConnectionRecord(p1) |
| 236 | |
| 237 | c1 = r1.dbapi_connection |
| 238 | c2 = r1.get_connection() |
| 239 | is_(c1, c2) |
| 240 | |
| 241 | r1.close() |
| 242 | |
| 243 | assert not r1.dbapi_connection |
| 244 | eq_(c1.mock_calls, [call.close()]) |
| 245 | |
| 246 | c2 = r1.get_connection() |
| 247 | |
| 248 | is_not(c1, c2) |
| 249 | is_(c2, r1.dbapi_connection) |
| 250 | |
| 251 | eq_(c2.mock_calls, []) |
| 252 | |
| 253 | @testing.combinations( |
| 254 | ( |