@@ -391,12 +391,6 @@ def _prunetraceback(self, excinfo):
391391 excinfo .traceback = ntraceback .filter ()
392392
393393
394- def _check_initialpaths_for_relpath (session , fspath ):
395- for initial_path in session ._initialpaths :
396- if fspath .common (initial_path ) == initial_path :
397- return fspath .relto (initial_path )
398-
399-
400394class FSHookProxy :
401395 def __init__ (
402396 self , fspath : py .path .local , pm : PytestPluginManager , remove_mods
@@ -427,15 +421,8 @@ def __init__(
427421
428422 if nodeid is None :
429423 nodeid = session ._node_location_to_relpath (self .fspath )
430-
431- if not nodeid :
432- if not nodeid :
433- assert 0 , (2 , self .fspath , parent , config , session )
434- nodeid = _check_initialpaths_for_relpath (session , fspath )
435- if not nodeid :
436- assert 0 , (self .fspath , parent , config , session )
437- nodeid = str (self .fspath )
438- if nodeid and os .sep != SEP :
424+ assert nodeid , (2 , fspath , session .config .rootdir )
425+ if os .sep != SEP :
439426 nodeid = nodeid .replace (os .sep , SEP )
440427
441428 super ().__init__ (name , parent , config , session , nodeid = nodeid , fspath = fspath )
0 commit comments