@@ -351,7 +351,7 @@ def __init__(self, pyfuncitem):
351
351
self .fixturename = None
352
352
#: Scope string, one of "function", "class", "module", "session"
353
353
self .scope = "function"
354
- self ._fixture_defs = {} # argname -> FixtureDef
354
+ self ._fixture_defs = {} # type: Dict[str, FixtureDef]
355
355
fixtureinfo = pyfuncitem ._fixtureinfo
356
356
self ._arg2fixturedefs = fixtureinfo .name2fixturedefs .copy ()
357
357
self ._arg2index = {}
@@ -426,7 +426,8 @@ def module(self):
426
426
@scopeproperty ()
427
427
def fspath (self ) -> py .path .local :
428
428
""" 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
430
431
431
432
@property
432
433
def keywords (self ):
@@ -549,7 +550,9 @@ def _compute_fixture_value(self, fixturedef):
549
550
source_lineno = frameinfo .lineno
550
551
source_path = py .path .local (source_path )
551
552
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 )
553
556
msg = (
554
557
"The requested fixture has no parameter defined for test:\n "
555
558
" {}\n \n "
@@ -558,7 +561,7 @@ def _compute_fixture_value(self, fixturedef):
558
561
funcitem .nodeid ,
559
562
fixturedef .argname ,
560
563
getlocation (fixturedef .func , funcitem .config .rootdir ),
561
- source_path ,
564
+ source_path_str ,
562
565
source_lineno ,
563
566
)
564
567
)
0 commit comments