@@ -222,33 +222,38 @@ class FalseNode:
222222 path = attr .ib ()
223223
224224
225+ _ROOT = Path .cwd ()
226+
227+
225228@pytest .mark .integration
226229@pytest .mark .parametrize (
227230 "node, paths, expectation, expected" ,
228231 [
229232 (
230- FilePathNode .from_path (Path ("src/module.py" )),
231- [Path ( "src " )],
233+ FilePathNode .from_path (_ROOT . joinpath ("src/module.py" )),
234+ [_ROOT . joinpath ( "alternative_src " )],
232235 pytest .raises (ValueError , match = "A node must be" ),
233236 None ,
234237 ),
235238 (
236- FalseNode (Path ("src/module.py" )),
237- [Path ("src" )],
239+ FalseNode (_ROOT . joinpath ("src/module.py" )),
240+ [_ROOT . joinpath ("src" )],
238241 pytest .raises (ValueError , match = "Unknown node" ),
239242 None ,
240243 ),
241244 (
242245 DummyTask (
243- Path ("top/src/module.py" ), "top/src/module.py::task_func" , "task_func"
246+ _ROOT .joinpath ("top/src/module.py" ),
247+ _ROOT .joinpath ("top/src/module.py" ).as_posix () + "::task_func" ,
248+ "task_func" ,
244249 ),
245- [Path ("top/src" )],
250+ [_ROOT . joinpath ("top/src" )],
246251 does_not_raise (),
247252 "src/module.py::task_func" ,
248253 ),
249254 (
250- FilePathNode .from_path (Path ("top/src/module.py" ). resolve ( )),
251- [Path ("top/src" ). resolve ( )],
255+ FilePathNode .from_path (_ROOT . joinpath ("top/src/module.py" )),
256+ [_ROOT . joinpath ("top/src" )],
252257 does_not_raise (),
253258 "src/module.py" ,
254259 ),
0 commit comments