| 262 | (pool.AssertionPool, {}), |
| 263 | ) |
| 264 | def test_recreate_state(self, pool_cls, pool_args): |
| 265 | creator = object() |
| 266 | pool_args["pre_ping"] = True |
| 267 | pool_args["reset_on_return"] = "commit" |
| 268 | pool_args["recycle"] = 35 |
| 269 | pool_args["logging_name"] = "somepool" |
| 270 | pool_args["dialect"] = default.DefaultDialect() |
| 271 | pool_args["echo"] = "debug" |
| 272 | |
| 273 | p1 = pool_cls(creator=creator, **pool_args) |
| 274 | |
| 275 | cls_keys = dir(pool_cls) |
| 276 | |
| 277 | d1 = dict(p1.__dict__) |
| 278 | |
| 279 | p2 = p1.recreate() |
| 280 | |
| 281 | d2 = dict(p2.__dict__) |
| 282 | |
| 283 | for k in cls_keys: |
| 284 | d1.pop(k, None) |
| 285 | d2.pop(k, None) |
| 286 | |
| 287 | for k in ( |
| 288 | "_invoke_creator", |
| 289 | "_pool", |
| 290 | "_overflow_lock", |
| 291 | "_fairy", |
| 292 | "_conn", |
| 293 | "logger", |
| 294 | ): |
| 295 | if k in d2: |
| 296 | d2[k] = mock.ANY |
| 297 | |
| 298 | eq_(d1, d2) |
| 299 | |
| 300 | eq_(p1.echo, p2.echo) |
| 301 | is_(p1._dialect, p2._dialect) |
| 302 | |
| 303 | if "use_lifo" in pool_args: |
| 304 | eq_(p1._pool.use_lifo, p2._pool.use_lifo) |
| 305 | |
| 306 | @testing.combinations( |
| 307 | (pool.QueuePool, False), |