diff --git a/test/test_fx.py b/test/test_fx.py index 3ab3023bc73c..b5d03a86a177 100644 --- a/test/test_fx.py +++ b/test/test_fx.py @@ -117,12 +117,12 @@ def forward(self, *args, **kwargs): def test_args_kwargs_no_self(self): class T(torch.nn.Module): - def forward(*args, **kwargs): + def forward(*args, **kwargs): # noqa: B902 self = args[0] return torch.relu(args[1]) t = T() - with self.assertRaisesRegex(RuntimeError, 'cannot be part of \*args expansion'): + with self.assertRaisesRegex(RuntimeError, r'cannot be part of \*args expansion'): self.checkGraphModule(t, (torch.rand(1), torch.rand(1)), {'foo': torch.rand(1)}) def test_fx_shifts(self):