1
- import sys
2
1
import warnings
3
2
from collections import defaultdict
3
+ from collections .abc import Sequence
4
4
from pathlib import Path
5
- from typing import Dict
6
- from typing import List
5
+ from typing import Literal
7
6
from typing import Optional
8
- from typing import Sequence
9
- from typing import Tuple
10
7
from typing import Union
11
8
12
9
import attr
28
25
from pytest_rich .header import generate_header_panel
29
26
from pytest_rich .traceback import RichExceptionChainRepr
30
27
31
- if sys .version_info < (3 , 8 ):
32
- from typing_extensions import Literal
33
- else :
34
- from typing import Literal
35
-
36
28
HORIZONTAL_PAD = (0 , 1 , 0 , 1 )
37
29
38
30
@@ -48,11 +40,11 @@ def __attrs_post_init__(self):
48
40
self .runtest_progress : Optional [Progress ] = None
49
41
self .total_items_collected = 0
50
42
self .total_items_completed = 0
51
- self .items_per_file : Dict [Path , List [pytest .Item ]] = {}
52
- self .status_per_item : Dict [str , RichTerminalReporter .Status ] = {}
53
- self .items : Dict [str , pytest .Item ] = {}
54
- self .runtest_tasks_per_file : Dict [Path , TaskID ] = {}
55
- self .categorized_reports : Dict [str , List [pytest .TestReport ]] = defaultdict (list )
43
+ self .items_per_file : dict [Path , list [pytest .Item ]] = {}
44
+ self .status_per_item : dict [str , RichTerminalReporter .Status ] = {}
45
+ self .items : dict [str , pytest .Item ] = {}
46
+ self .runtest_tasks_per_file : dict [Path , TaskID ] = {}
47
+ self .categorized_reports : dict [str , list [pytest .TestReport ]] = defaultdict (list )
56
48
self .summary : Optional [Live ] = None
57
49
self .total_duration : float = 0
58
50
self .console .record = self .config .getoption ("rich_capture" ) is not None
@@ -114,7 +106,7 @@ def pytest_deselected(self, items: Sequence[pytest.Item]) -> None: ...
114
106
def pytest_plugin_registered (self , plugin ) -> None : ...
115
107
116
108
def pytest_runtest_logstart (
117
- self , nodeid : str , location : Tuple [str , Optional [int ], str ]
109
+ self , nodeid : str , location : tuple [str , Optional [int ], str ]
118
110
) -> None :
119
111
if self .runtest_progress is None :
120
112
self .runtest_progress = Progress (SpinnerColumn (), "{task.description}" )
0 commit comments