|
8 | 8 | from typing import Iterator
|
9 | 9 | from typing import List
|
10 | 10 | from typing import Mapping
|
| 11 | +from typing import MutableMapping |
11 | 12 | from typing import NamedTuple
|
12 | 13 | from typing import Optional
|
13 | 14 | from typing import Sequence
|
@@ -94,8 +95,7 @@ def param(
|
94 | 95 | if isinstance(marks, MarkDecorator):
|
95 | 96 | marks = (marks,)
|
96 | 97 | else:
|
97 |
| - # TODO(py36): Change to collections.abc.Collection. |
98 |
| - assert isinstance(marks, (collections.abc.Sequence, set)) |
| 98 | + assert isinstance(marks, collections.abc.Collection) |
99 | 99 |
|
100 | 100 | if id is not None:
|
101 | 101 | if not isinstance(id, str):
|
@@ -475,13 +475,12 @@ def test_function():
|
475 | 475 |
|
476 | 476 | # See TYPE_CHECKING above.
|
477 | 477 | if TYPE_CHECKING:
|
478 |
| - # TODO(py36): Change to builtin annotation syntax. |
479 |
| - skip = _SkipMarkDecorator(Mark("skip", (), {})) |
480 |
| - skipif = _SkipifMarkDecorator(Mark("skipif", (), {})) |
481 |
| - xfail = _XfailMarkDecorator(Mark("xfail", (), {})) |
482 |
| - parametrize = _ParametrizeMarkDecorator(Mark("parametrize", (), {})) |
483 |
| - usefixtures = _UsefixturesMarkDecorator(Mark("usefixtures", (), {})) |
484 |
| - filterwarnings = _FilterwarningsMarkDecorator(Mark("filterwarnings", (), {})) |
| 478 | + skip: _SkipMarkDecorator |
| 479 | + skipif: _SkipifMarkDecorator |
| 480 | + xfail: _XfailMarkDecorator |
| 481 | + parametrize: _ParametrizeMarkDecorator |
| 482 | + usefixtures: _UsefixturesMarkDecorator |
| 483 | + filterwarnings: _FilterwarningsMarkDecorator |
485 | 484 |
|
486 | 485 | def __getattr__(self, name: str) -> MarkDecorator:
|
487 | 486 | if name[0] == "_":
|
@@ -527,9 +526,8 @@ def __getattr__(self, name: str) -> MarkDecorator:
|
527 | 526 | MARK_GEN = MarkGenerator()
|
528 | 527 |
|
529 | 528 |
|
530 |
| -# TODO(py36): inherit from typing.MutableMapping[str, Any]. |
531 | 529 | @final
|
532 |
| -class NodeKeywords(collections.abc.MutableMapping): # type: ignore[type-arg] |
| 530 | +class NodeKeywords(MutableMapping[str, Any]): |
533 | 531 | def __init__(self, node: "Node") -> None:
|
534 | 532 | self.node = node
|
535 | 533 | self.parent = node.parent
|
|
0 commit comments