[BE] enable ruff rule Q from flake8-quotes (#127713)

Enable [ruff rule `Q`](https://docs.astral.sh/ruff/rules/#flake8-quotes-q) from flake8-quotes. Fixes:

- [avoidable-escaped-quote (Q003)](https://docs.astral.sh/ruff/rules/avoidable-escaped-quote/#avoidable-escaped-quote-q003)
- [unnecessary-escaped-quote (Q004)](https://docs.astral.sh/ruff/rules/unnecessary-escaped-quote/#unnecessary-escaped-quote-q004)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127713
Approved by: https://github.com/ezyang
This commit is contained in:
Xuehai Pan
2024-06-02 23:25:26 +00:00
committed by PyTorch MergeBot
parent 139b9c6529
commit 8b08b0f340
20 changed files with 48 additions and 46 deletions

View File

@ -330,7 +330,7 @@ class TestStaticModule(TestCase):
raise RuntimeError(
"Tried execution of add.Tensors with incompatible shape. "
"Exception raised by forked runtime execution does "
f"not contain expected substring: \"{expected_error_msg}\""
f'not contain expected substring: "{expected_error_msg}"'
) from error
"""
@ -360,7 +360,7 @@ class TestStaticModule(TestCase):
raise RuntimeError(
"Tried execution of add.Tensors with incompatible shape. "
"Exception raised by forked runtime execution does "
f"not contain expected substring: \"{expected_error_msg}\""
f'not contain expected substring: "{expected_error_msg}"'
) from error
def test_multihead_attention_layer(self):