|
20 | 20 | from os import getenv, path |
21 | 21 | from pathlib import Path |
22 | 22 | from re import sub as re_sub |
23 | | -from typing import Any, Dict, Union |
| 23 | +from typing import Any, Union |
24 | 24 | from unittest import TestCase |
25 | 25 | from xml.sax.saxutils import escape as xml_escape, quoteattr as xml_quoteattr # nosec:B406 |
26 | 26 |
|
@@ -62,12 +62,12 @@ def getSnapshotFile(snapshot_name: str) -> str: # noqa: N802 |
62 | 62 |
|
63 | 63 | @classmethod |
64 | 64 | def writeSnapshot(cls, snapshot_name: str, data: str) -> None: # noqa: N802 |
65 | | - with open(cls.getSnapshotFile(snapshot_name), 'wt', encoding='utf8', newline='\n') as sf: |
| 65 | + with open(cls.getSnapshotFile(snapshot_name), 'w', encoding='utf8', newline='\n') as sf: |
66 | 66 | sf.write(data) |
67 | 67 |
|
68 | 68 | @classmethod |
69 | 69 | def readSnapshot(cls, snapshot_name: str) -> str: # noqa: N802 |
70 | | - with open(cls.getSnapshotFile(snapshot_name), 'rt', encoding='utf8', newline='\n') as sf: |
| 70 | + with open(cls.getSnapshotFile(snapshot_name), encoding='utf8', newline='\n') as sf: |
71 | 71 | return sf.read() |
72 | 72 |
|
73 | 73 | def assertEqualSnapshot(self: Union[TestCase, 'SnapshotMixin'], # noqa: N802 |
@@ -227,7 +227,7 @@ def make_comparable(bom: str, of: OutputFormat) -> str: |
227 | 227 | # endregion reproducible test results |
228 | 228 |
|
229 | 229 |
|
230 | | -def load_pyproject() -> Dict[str, Any]: |
| 230 | +def load_pyproject() -> dict[str, Any]: |
231 | 231 | if sys.version_info >= (3, 11): |
232 | 232 | from tomllib import load as toml_load |
233 | 233 | else: |
|
0 commit comments