File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -110,14 +110,9 @@ class AssertionState:
110
110
def __init__ (self , config : Config , mode ) -> None :
111
111
self .mode = mode
112
112
self .trace = config .trace .root .get ("assertion" )
113
- self .config = config
113
+ self .invocation_path = str ( config . invocation_params . dir )
114
114
self .hook : rewrite .AssertionRewritingHook | None = None
115
115
116
- @property
117
- def invocation_path (self ):
118
- """Get current root path (current working dir)"""
119
- return str (self .config .invocation_params .dir )
120
-
121
116
122
117
def install_importhook (config : Config ) -> rewrite .AssertionRewritingHook :
123
118
"""Try to install the rewrite hook, raise SystemError if it fails."""
Original file line number Diff line number Diff line change 12
12
from collections .abc import Iterable
13
13
from collections .abc import Sequence
14
14
import contextlib
15
- import dataclasses
16
15
from fnmatch import fnmatch
17
16
import gc
18
17
import importlib
41
40
42
41
from _pytest import timing
43
42
from _pytest ._code import Source
43
+ from _pytest .assertion .rewrite import assertstate_key
44
44
from _pytest .capture import _get_multicapture
45
45
from _pytest .compat import NOTSET
46
46
from _pytest .compat import NotSetType
@@ -751,11 +751,7 @@ def chdir(self) -> None:
751
751
"""
752
752
self ._monkeypatch .chdir (self .path )
753
753
self ._monkeypatch .setattr (
754
- self ._request .config ,
755
- "invocation_params" ,
756
- dataclasses .replace (
757
- self ._request .config .invocation_params , dir = Path (self ._path )
758
- ),
754
+ self ._request .config .stash [assertstate_key ], "invocation_path" , self .path
759
755
)
760
756
761
757
def _makefile (
You can’t perform that action at this time.
0 commit comments