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:
110110 def __init__ (self , config : Config , mode ) -> None :
111111 self .mode = mode
112112 self .trace = config .trace .root .get ("assertion" )
113- self .config = config
113+ self .invocation_path = str ( config . invocation_params . dir )
114114 self .hook : rewrite .AssertionRewritingHook | None = None
115115
116- @property
117- def invocation_path (self ):
118- """Get current root path (current working dir)"""
119- return str (self .config .invocation_params .dir )
120-
121116
122117def install_importhook (config : Config ) -> rewrite .AssertionRewritingHook :
123118 """Try to install the rewrite hook, raise SystemError if it fails."""
Original file line number Diff line number Diff line change 1212from collections .abc import Iterable
1313from collections .abc import Sequence
1414import contextlib
15- import dataclasses
1615from fnmatch import fnmatch
1716import gc
1817import importlib
4140
4241from _pytest import timing
4342from _pytest ._code import Source
43+ from _pytest .assertion .rewrite import assertstate_key
4444from _pytest .capture import _get_multicapture
4545from _pytest .compat import NOTSET
4646from _pytest .compat import NotSetType
@@ -751,11 +751,7 @@ def chdir(self) -> None:
751751 """
752752 self ._monkeypatch .chdir (self .path )
753753 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
759755 )
760756
761757 def _makefile (
You can’t perform that action at this time.
0 commit comments