(self)
| 996 | |
| 997 | @testing.requires.sqlite |
| 998 | def test_wrapper_hooks(self): |
| 999 | def get_dialect_cls(url): |
| 1000 | url = url.set(drivername="sqlite") |
| 1001 | return url.get_dialect() |
| 1002 | |
| 1003 | global WrapperFactory |
| 1004 | WrapperFactory = Mock() |
| 1005 | WrapperFactory.get_dialect_cls.side_effect = get_dialect_cls |
| 1006 | |
| 1007 | registry.register("wrapperdialect", __name__, "WrapperFactory") |
| 1008 | |
| 1009 | from sqlalchemy.dialects import sqlite |
| 1010 | |
| 1011 | e = create_engine("wrapperdialect://") |
| 1012 | |
| 1013 | eq_(e.dialect.name, "sqlite") |
| 1014 | assert isinstance(e.dialect, sqlite.dialect) |
| 1015 | |
| 1016 | eq_( |
| 1017 | WrapperFactory.mock_calls, |
| 1018 | [ |
| 1019 | call.get_dialect_cls(url.make_url("wrapperdialect://")), |
| 1020 | call.engine_created(e), |
| 1021 | ], |
| 1022 | ) |
| 1023 | |
| 1024 | @testing.requires.sqlite |
| 1025 | def test_plugin_url_registration(self): |
nothing calls this directly
no test coverage detected