36
36
from typing import Type
37
37
38
38
from _pytest import nodes
39
+ from _pytest .main import Session
39
40
40
41
41
42
@attr .s (frozen = True )
@@ -44,7 +45,7 @@ class PseudoFixtureDef:
44
45
scope = attr .ib ()
45
46
46
47
47
- def pytest_sessionstart (session ):
48
+ def pytest_sessionstart (session : "Session" ):
48
49
import _pytest .python
49
50
import _pytest .nodes
50
51
@@ -510,13 +511,11 @@ def _get_fixturestack(self):
510
511
values .append (fixturedef )
511
512
current = current ._parent_request
512
513
513
- def _compute_fixture_value (self , fixturedef ) :
514
+ def _compute_fixture_value (self , fixturedef : "FixtureDef" ) -> None :
514
515
"""
515
516
Creates a SubRequest based on "self" and calls the execute method of the given fixturedef object. This will
516
517
force the FixtureDef object to throw away any previous results and compute a new fixture value, which
517
518
will be stored into the FixtureDef object itself.
518
-
519
- :param FixtureDef fixturedef:
520
519
"""
521
520
# prepare a subrequest object before calling fixture function
522
521
# (latter managed by fixturedef)
@@ -544,9 +543,8 @@ def _compute_fixture_value(self, fixturedef):
544
543
if has_params :
545
544
frame = inspect .stack ()[3 ]
546
545
frameinfo = inspect .getframeinfo (frame [0 ])
547
- source_path = frameinfo .filename
546
+ source_path = py . path . local ( frameinfo .filename )
548
547
source_lineno = frameinfo .lineno
549
- source_path = py .path .local (source_path )
550
548
if source_path .relto (funcitem .config .rootdir ):
551
549
source_path = source_path .relto (funcitem .config .rootdir )
552
550
msg = (
0 commit comments