From 86fe5712ad6026246787066ab6a12c89f41f70d7 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Wed, 7 Jun 2023 09:33:28 +0200 Subject: [PATCH] [ast.Str] Use ast.Constant instead pending removal in python 3.14 --- src/_pytest/assertion/rewrite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index ab8169da2ef..ff6333f24f0 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -680,7 +680,7 @@ def run(self, mod: ast.Module) -> None: if ( expect_docstring and isinstance(item, ast.Expr) - and isinstance(item.value, ast.Str) + and isinstance(item.value, ast.Constant) ): doc = item.value.s if self.is_rewrite_disabled(doc):