@@ -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 = {} # argname -> FixtureDef
354+ self ._fixture_defs = {} # type: Dict[str, FixtureDef]
355355 fixtureinfo = pyfuncitem ._fixtureinfo
356356 self ._arg2fixturedefs = fixtureinfo .name2fixturedefs .copy ()
357357 self ._arg2index = {}
@@ -426,7 +426,8 @@ 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- return self ._pyfuncitem .fspath
429+ # TODO: Remove ignore once _pyfuncitem is properly typed.
430+ return self ._pyfuncitem .fspath # type: ignore
430431
431432 @property
432433 def keywords (self ):
@@ -549,7 +550,9 @@ def _compute_fixture_value(self, fixturedef):
549550 source_lineno = frameinfo .lineno
550551 source_path = py .path .local (source_path )
551552 if source_path .relto (funcitem .config .rootdir ):
552- source_path = 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 )
553556 msg = (
554557 "The requested fixture has no parameter defined for test:\n "
555558 " {}\n \n "
@@ -558,7 +561,7 @@ def _compute_fixture_value(self, fixturedef):
558561 funcitem .nodeid ,
559562 fixturedef .argname ,
560563 getlocation (fixturedef .func , funcitem .config .rootdir ),
561- source_path ,
564+ source_path_str ,
562565 source_lineno ,
563566 )
564567 )
0 commit comments