Skip to content

Commit dbc5a59

Browse files
committed
13403: Disable assertion rewriting for external modules - add test for plugins
1 parent e0bbaa3 commit dbc5a59

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/_pytest/assertion/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def rootpath(self):
123123
return os.path.abspath(os.sep)
124124

125125

126-
127126
def install_importhook(config: Config) -> rewrite.AssertionRewritingHook:
128127
"""Try to install the rewrite hook, raise SystemError if it fails."""
129128
config.stash[assertstate_key] = AssertionState(config, "rewrite")

testing/test_assertrewrite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ def test_rootpath_base(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> No
13111311
monkeypatch.chdir(pytester.path)
13121312
state = AssertionState(config, "rewrite")
13131313
assert state.rootpath == str(pytester.path)
1314-
new_rootpath = pytester.path + "/test"
1314+
new_rootpath = str(pytester.path) + "/test"
13151315
if not os.path.exists(new_rootpath):
13161316
os.mkdir(new_rootpath)
13171317
monkeypatch.chdir(new_rootpath)

0 commit comments

Comments
 (0)