diff options
author | David Robertson <davidr@element.io> | 2023-03-23 15:07:32 +0000 |
---|---|---|
committer | David Robertson <davidr@element.io> | 2023-03-23 15:09:11 +0000 |
commit | af0145bf277b0bf66dc6e98e1adea04d919e8848 (patch) | |
tree | 62f457714a8a5bc1251e2e8b801dcbecd9ac093a | |
parent | wip 9 (diff) | |
download | synapse-af0145bf277b0bf66dc6e98e1adea04d919e8848.tar.xz |
wip 10
-rw-r--r-- | tests/http/federation/dmr_reproduce_mypy_zope_pain.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/http/federation/dmr_reproduce_mypy_zope_pain.py b/tests/http/federation/dmr_reproduce_mypy_zope_pain.py index 5e9ac7ba61..a7f5f132de 100644 --- a/tests/http/federation/dmr_reproduce_mypy_zope_pain.py +++ b/tests/http/federation/dmr_reproduce_mypy_zope_pain.py @@ -3,27 +3,25 @@ from typing import Optional from zope.interface import Interface, implementer -class IProtocol(Interface): +class IFoo(Interface): pass -@implementer(IProtocol) -class Protocol: +@implementer(IFoo) +class BaseFoo: pass -class _WrappingProtocol(Protocol): +class ChildFoo(BaseFoo): pass -class IProtocolFactory(Interface): - def buildProtocol() -> Optional[IProtocol]: +class IFooFactory(Interface): + def build() -> Optional[IFoo]: pass -def _make_connection( - client_factory: IProtocolFactory, -) -> None: - client_protocol = client_factory.buildProtocol() - assert isinstance(client_protocol, _WrappingProtocol) +def build_and_use_foo(client_factory: IFooFactory) -> None: + client_protocol = client_factory.build() + assert isinstance(client_protocol, ChildFoo) print("Hello") |