@@ -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 = {} # type: Dict[str, FixtureDef]
354
+ self ._fixture_defs = {} # argname -> FixtureDef
355
355
fixtureinfo = pyfuncitem ._fixtureinfo
356
356
self ._arg2fixturedefs = fixtureinfo .name2fixturedefs .copy ()
357
357
self ._arg2index = {}
@@ -426,8 +426,7 @@ 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
- # TODO: Remove ignore once _pyfuncitem is properly typed.
430
- return self ._pyfuncitem .fspath # type: ignore
429
+ return self ._pyfuncitem .fspath
431
430
432
431
@property
433
432
def keywords (self ):
@@ -550,9 +549,7 @@ def _compute_fixture_value(self, fixturedef):
550
549
source_lineno = frameinfo .lineno
551
550
source_path = py .path .local (source_path )
552
551
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 )
556
553
msg = (
557
554
"The requested fixture has no parameter defined for test:\n "
558
555
" {}\n \n "
@@ -561,7 +558,7 @@ def _compute_fixture_value(self, fixturedef):
561
558
funcitem .nodeid ,
562
559
fixturedef .argname ,
563
560
getlocation (fixturedef .func , funcitem .config .rootdir ),
564
- source_path_str ,
561
+ source_path ,
565
562
source_lineno ,
566
563
)
567
564
)
0 commit comments