File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
- from typing import TYPE_CHECKING
1
+ import functools
2
+ from pathlib import Path
3
+ from typing import Optional
2
4
5
+ from ..compat import LEGACY_PATH
3
6
from _pytest .nodes import _imply_path
4
7
5
- if TYPE_CHECKING :
6
- from ..compat import LEGACY_PATH
7
-
8
-
9
- import functools
10
-
11
8
# hookname: (Path, LEGACY_PATH)
12
9
imply_paths_hooks = {
13
10
"pytest_ignore_collect" : ("fspath" , "path" ),
@@ -31,8 +28,8 @@ def __getattr__(self, key):
31
28
32
29
@functools .wraps (hook )
33
30
def fixed_hook (** kw ):
34
- path_value = kw .pop (path_var , None )
35
- fspath_value : " LEGACY_PATH" = kw .pop (fspath_var , None )
31
+ path_value : Optional [ Path ] = kw .pop (path_var , None )
32
+ fspath_value : Optional [ LEGACY_PATH ] = kw .pop (fspath_var , None )
36
33
path_value , fspath_value = _imply_path (path_value , fspath_value )
37
34
kw [path_var ] = path_value
38
35
kw [fspath_var ] = fspath_value
You can’t perform that action at this time.
0 commit comments