|
1 | 1 | from typing import Any
|
| 2 | +from typing import NoReturn |
| 3 | +from typing import TypeVar |
2 | 4 |
|
3 |
| -from . import base as base |
4 |
| -from .. import util as util |
5 |
| -from ..sql import ddl as ddl |
| 5 | +from . import base |
| 6 | +from . import interfaces |
| 7 | +from ..sql.compiler import Compiled |
| 8 | + |
| 9 | +_TMockConnection = TypeVar("_TMockConnection", bound=MockConnection) |
6 | 10 |
|
7 | 11 | class MockConnection(base.Connectable):
|
8 |
| - def __init__(self, dialect: Any, execute: Any) -> None: ... |
9 |
| - engine: Any = ... |
10 |
| - dialect: Any = ... |
11 |
| - name: Any = ... |
12 |
| - def schema_for_object(self, obj: Any): ... |
13 |
| - def connect(self, **kwargs: Any): ... |
14 |
| - def execution_options(self, **kw: Any): ... |
15 |
| - def compiler(self, statement: Any, parameters: Any, **kwargs: Any): ... |
| 12 | + def __init__(self, dialect: interfaces.Dialect, execute: Any) -> None: ... |
| 13 | + engine: base.Engine = ... |
| 14 | + dialect: interfaces.Dialect = ... |
| 15 | + name: str = ... |
| 16 | + def schema_for_object(self, obj: Any) -> str: ... |
| 17 | + def connect(self: _TMockConnection, **kwargs: Any) -> _TMockConnection: ... # type: ignore[override] |
| 18 | + def execution_options( |
| 19 | + self: _TMockConnection, **opt: Any |
| 20 | + ) -> _TMockConnection: ... |
| 21 | + def compiler( |
| 22 | + self, statement: Any, parameters: Any, **kwargs: Any |
| 23 | + ) -> Compiled: ... |
16 | 24 | def create(self, entity: Any, **kwargs: Any) -> None: ...
|
17 | 25 | def drop(self, entity: Any, **kwargs: Any) -> None: ...
|
18 | 26 | def execute(
|
19 | 27 | self, object_: Any, *multiparams: Any, **params: Any
|
20 |
| - ) -> None: ... |
| 28 | + ) -> NoReturn: ... |
21 | 29 |
|
22 |
| -def create_mock_engine(url: Any, executor: Any, **kw: Any): ... |
| 30 | +def create_mock_engine( |
| 31 | + url: Any, executor: Any, **kw: Any |
| 32 | +) -> MockConnection: ... |
0 commit comments