(self, q, dispose=True)
| 544 | return tsa.pool.SingletonThreadPool(creator=mock.Mock()) |
| 545 | |
| 546 | def _test_queuepool(self, q, dispose=True): |
| 547 | conn = q.connect() |
| 548 | conn.close() |
| 549 | conn = None |
| 550 | |
| 551 | conn = q.connect() |
| 552 | conn.close() |
| 553 | conn = None |
| 554 | |
| 555 | conn = q.connect() |
| 556 | conn._close_special(transaction_reset=True) |
| 557 | conn = None |
| 558 | |
| 559 | conn = q.connect() |
| 560 | conn._close_special(transaction_reset=False) |
| 561 | conn = None |
| 562 | |
| 563 | conn = q.connect() |
| 564 | conn = None |
| 565 | del conn |
| 566 | lazy_gc() |
| 567 | q.dispose() |
| 568 | |
| 569 | eq_( |
| 570 | [buf.msg for buf in self.buf.buffer], |
| 571 | [ |
| 572 | "Created new connection %r", |
| 573 | "Connection %r checked out from pool", |
| 574 | "Connection %r being returned to pool", |
| 575 | "Connection %s rollback-on-return", |
| 576 | "Connection %r checked out from pool", |
| 577 | "Connection %r being returned to pool", |
| 578 | "Connection %s rollback-on-return", |
| 579 | "Connection %r checked out from pool", |
| 580 | "Connection %r being returned to pool", |
| 581 | "Connection %s reset, transaction already reset", |
| 582 | "Connection %r checked out from pool", |
| 583 | "Connection %r being returned to pool", |
| 584 | "Connection %s rollback-on-return", |
| 585 | "Connection %r checked out from pool", |
| 586 | "Connection %r being returned to pool", |
| 587 | "Connection %s rollback-on-return", |
| 588 | "%s connection %r", |
| 589 | ] |
| 590 | + (["Pool disposed. %s"] if dispose else []), |
| 591 | ) |
| 592 | |
| 593 | def test_stpool_echo(self): |
| 594 | q = self._stpool_echo_fixture() |
no test coverage detected