File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change
1
+ from pathlib import Path
1
2
from typing import cast
2
3
from typing import List
3
4
from typing import Type
@@ -69,23 +70,23 @@ def test():
69
70
70
71
def test__check_initialpaths_for_relpath () -> None :
71
72
"""Ensure that it handles dirs, and does not always use dirname."""
72
- cwd = py . path . local ()
73
+ cwd = Path . cwd ()
73
74
74
75
class FakeSession1 :
75
- _initialpaths = [ cwd ]
76
+ _initialpaths = frozenset ({ cwd })
76
77
77
78
session = cast (pytest .Session , FakeSession1 )
78
79
79
- assert nodes ._check_initialpaths_for_relpath (session , cwd ) == ""
80
+ assert nodes ._check_initialpaths_for_relpath (session , py . path . local ( cwd ) ) == ""
80
81
81
- sub = cwd . join ( "file" )
82
+ sub = cwd / "file"
82
83
83
84
class FakeSession2 :
84
- _initialpaths = [ cwd ]
85
+ _initialpaths = frozenset ({ cwd })
85
86
86
87
session = cast (pytest .Session , FakeSession2 )
87
88
88
- assert nodes ._check_initialpaths_for_relpath (session , sub ) == "file"
89
+ assert nodes ._check_initialpaths_for_relpath (session , py . path . local ( sub ) ) == "file"
89
90
90
91
outside = py .path .local ("/outside" )
91
92
assert nodes ._check_initialpaths_for_relpath (session , outside ) is None
You can’t perform that action at this time.
0 commit comments