Misc typing fixes for tests, part 1 of N (#11323)

* Annotate HomeserverTestCase.servlets
* Correct annotation of federation_auth_origin
* Use AnyStr custom_headers instead of a Union

This allows (str, str) and (bytes, bytes).
This disallows (str, bytes) and (bytes, str)

* DomainSpecificString.SIGIL is a ClassVar
This commit is contained in:
David Robertson 2021-11-12 15:50:54 +00:00 committed by GitHub
parent 95547e5300
commit 4c96ce396e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 29 deletions

View file

@ -19,6 +19,7 @@ from collections import namedtuple
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
Dict,
Mapping,
MutableMapping,
@ -219,7 +220,7 @@ class DomainSpecificString(metaclass=abc.ABCMeta):
'domain' : The domain part of the name
"""
SIGIL: str = abc.abstractproperty() # type: ignore
SIGIL: ClassVar[str] = abc.abstractproperty() # type: ignore
localpart = attr.ib(type=str)
domain = attr.ib(type=str)