kikocis/auto-code-rover public
| 1 | diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py |
| 2 | --- a/src/_pytest/assertion/rewrite.py |
| 3 | +++ b/src/_pytest/assertion/rewrite.py |
| 4 | @@ -676,6 +676,7 @@ def run(self, mod: ast.Module) -> None: |
| 5 | expect_docstring |
| 6 | and isinstance(item, ast.Expr) |
| 7 | and isinstance(item.value, ast.Constant) |
| 8 | + and isinstance(item.value.value, str) |
| 9 | ): |
| 10 | doc = item.value.value |
| 11 | if self.is_rewrite_disabled(doc): |