@@ -351,7 +351,7 @@ def __init__(self, pyfuncitem):
351351 self .fixturename = None
352352 #: Scope string, one of "function", "class", "module", "session"
353353 self .scope = "function"
354- self ._fixture_defs = {} # type: Dict[str, FixtureDef]
354+ self ._fixture_defs = {} # argname -> FixtureDef
355355 fixtureinfo = pyfuncitem ._fixtureinfo
356356 self ._arg2fixturedefs = fixtureinfo .name2fixturedefs .copy ()
357357 self ._arg2index = {}
@@ -426,8 +426,7 @@ def module(self):
426426 @scopeproperty ()
427427 def fspath (self ) -> py .path .local :
428428 """ the file system path of the test module which collected this test. """
429- # TODO: Remove ignore once _pyfuncitem is properly typed.
430- return self ._pyfuncitem .fspath # type: ignore
429+ return self ._pyfuncitem .fspath
431430
432431 @property
433432 def keywords (self ):
@@ -550,9 +549,7 @@ def _compute_fixture_value(self, fixturedef):
550549 source_lineno = frameinfo .lineno
551550 source_path = py .path .local (source_path )
552551 if source_path .relto (funcitem .config .rootdir ):
553- source_path_str = source_path .relto (funcitem .config .rootdir )
554- else :
555- source_path_str = str (source_path )
552+ source_path = source_path .relto (funcitem .config .rootdir )
556553 msg = (
557554 "The requested fixture has no parameter defined for test:\n "
558555 " {}\n \n "
@@ -561,7 +558,7 @@ def _compute_fixture_value(self, fixturedef):
561558 funcitem .nodeid ,
562559 fixturedef .argname ,
563560 getlocation (fixturedef .func , funcitem .config .rootdir ),
564- source_path_str ,
561+ source_path ,
565562 source_lineno ,
566563 )
567564 )
0 commit comments