(self)
| 1009 | |
| 1010 | @testing.requires.sqlite |
| 1011 | def test_wrapper_hooks(self): |
| 1012 | def get_dialect_cls(url): |
| 1013 | url = url.set(drivername="sqlite") |
| 1014 | return url.get_dialect() |
| 1015 | |
| 1016 | global WrapperFactory |
| 1017 | WrapperFactory = Mock() |
| 1018 | WrapperFactory.get_dialect_cls.side_effect = get_dialect_cls |
| 1019 | |
| 1020 | registry.register("wrapperdialect", __name__, "WrapperFactory") |
| 1021 | |
| 1022 | from sqlalchemy.dialects import sqlite |
| 1023 | |
| 1024 | e = create_engine("wrapperdialect://") |
| 1025 | |
| 1026 | eq_(e.dialect.name, "sqlite") |
| 1027 | assert isinstance(e.dialect, sqlite.dialect) |
| 1028 | |
| 1029 | eq_( |
| 1030 | WrapperFactory.mock_calls, |
| 1031 | [ |
| 1032 | call.get_dialect_cls(url.make_url("wrapperdialect://")), |
| 1033 | call.engine_created(e), |
| 1034 | ], |
| 1035 | ) |
| 1036 | |
| 1037 | @testing.requires.sqlite |
| 1038 | def test_plugin_url_registration(self): |
nothing calls this directly
no test coverage detected