|
1 | 1 | import os |
2 | 2 | from collections import defaultdict |
3 | | -from typing import ByteString, DefaultDict, Iterator, List, Optional |
| 3 | +from collections.abc import ByteString, Iterator |
| 4 | +from typing import Optional |
4 | 5 |
|
5 | 6 | import pytest |
6 | 7 | from selfie_lib import ( |
@@ -92,7 +93,7 @@ def walk_callback(walk: Iterator[TypedPath]) -> bool: |
92 | 93 |
|
93 | 94 | @pytest.hookimpl |
94 | 95 | def pytest_collection_modifyitems( |
95 | | - session: pytest.Session, config: pytest.Config, items: List[pytest.Item] |
| 96 | + session: pytest.Session, config: pytest.Config, items: list[pytest.Item] |
96 | 97 | ) -> None: |
97 | 98 | settings = SelfieSettingsAPI(config) |
98 | 99 | system = PytestSnapshotSystem(settings) |
@@ -152,7 +153,7 @@ def __init__(self, settings: SelfieSettingsAPI): |
152 | 153 | self.__inline_write_tracker = InlineWriteTracker() |
153 | 154 | self.__toBeFileWriteTracker = ToBeFileWriteTracker() |
154 | 155 |
|
155 | | - self.__progress_per_file: DefaultDict[TypedPath, SnapshotFileProgress] = ( |
| 156 | + self.__progress_per_file: defaultdict[TypedPath, SnapshotFileProgress] = ( |
156 | 157 | _keydefaultdict(lambda key: SnapshotFileProgress(self, key)) # type: ignore |
157 | 158 | ) # type: ignore |
158 | 159 | # the test which is running right now, if any |
@@ -249,7 +250,9 @@ def write_to_be_file( |
249 | 250 | self, path: TypedPath, data: "ByteString", call: CallStack |
250 | 251 | ) -> None: |
251 | 252 | # Directly write to disk using ToBeFileWriteTracker |
252 | | - self.__toBeFileWriteTracker.writeToDisk(path, bytes(data), call, self.layout_pytest) |
| 253 | + self.__toBeFileWriteTracker.writeToDisk( |
| 254 | + path, bytes(data), call, self.layout_pytest |
| 255 | + ) |
253 | 256 |
|
254 | 257 |
|
255 | 258 | class DiskStoragePytest(DiskStorage): |
@@ -469,6 +472,6 @@ def pytest_addoption(parser): |
469 | 472 | parser.addini("HELLO", "Dummy pytest.ini setting") |
470 | 473 |
|
471 | 474 |
|
472 | | -@pytest.fixture() |
| 475 | +@pytest.fixture |
473 | 476 | def bar(request): |
474 | 477 | return request.config.option.dest_foo |
0 commit comments