@@ -2904,7 +2904,7 @@ def test_sequence_parsing(self):
29042904 ("return [x x]", "expected ]"),
29052905 ("return x, x,", True),
29062906 ("return bar(x, x,)", True),
2907- ("return bar()", "argument x not provided"),
2907+ ("return bar()", "Argument x not provided"),
29082908 ("for a, b, in x, x,:\n pass", "List of iterables"),
29092909 ("a, b, = x, x,\n return a + b", True)
29102910 ]
@@ -4509,7 +4509,7 @@ def comp(l1, l2):
45094509 self.assertEqual(comp([1, 2, 3], [4, 5]), [3, 6, 9, 6, 7])
45104510
45114511 def test_comprehensions_wrong_expr_type(self):
4512- with self.assertRaisesRegex(RuntimeError, "arguments for call are not valid"):
4512+ with self.assertRaisesRegex(RuntimeError, "Arguments for call are not valid"):
45134513 @torch.jit.script
45144514 def comp(l):
45154515 # type: (List[int]) -> List[float]
@@ -5599,14 +5599,14 @@ def test_manual_unwrap_opt(x):
55995599 x = torch.jit._unwrap_optional(x)
56005600 return x # noqa: T484
56015601
5602- with self.assertRaisesRegex(RuntimeError, "arguments for call are not valid"):
5602+ with self.assertRaisesRegex(RuntimeError, "Arguments for call are not valid"):
56035603 @torch.jit.script
56045604 def or_error(x, y):
56055605 # type: (Optional[int], Optional[int]) -> None
56065606 if x is None or y is None:
56075607 print(x + y) # noqa: T484
56085608
5609- with self.assertRaisesRegex(RuntimeError, "arguments for call are not valid"):
5609+ with self.assertRaisesRegex(RuntimeError, "Arguments for call are not valid"):
56105610 @torch.jit.script
56115611 def and_error(x, y):
56125612 # type: (Optional[int], Optional[int]) -> None
@@ -5615,15 +5615,15 @@ def and_error(x, y):
56155615 else:
56165616 print(x + y) # noqa: T484
56175617
5618- with self.assertRaisesRegex(RuntimeError, "arguments for call are not valid"):
5618+ with self.assertRaisesRegex(RuntimeError, "Arguments for call are not valid"):
56195619 @torch.jit.script
56205620 def named_var(x):
56215621 # type: (Optional[int]) -> None
56225622 x_none = x is not None
56235623 if x_none:
56245624 print(x + 1) # noqa: T484
56255625
5626- with self.assertRaisesRegex(RuntimeError, "arguments for call are not valid"):
5626+ with self.assertRaisesRegex(RuntimeError, "Arguments for call are not valid"):
56275627 @torch.jit.script
56285628 def named_var_and(x, y):
56295629 # type: (Optional[int], Optional[int]) -> None
@@ -8551,7 +8551,7 @@ def fn(x : torch.Tensor, y : Tensor, z) -> Tuple[Tensor, Tensor, Tensor]:
85518551 f.write(code)
85528552 fn = get_fn('test_type_annotation_py3', script_path)
85538553
8554- with self.assertRaisesRegex(RuntimeError, r"expected a value of type 'Tensor' for argument"
8554+ with self.assertRaisesRegex(RuntimeError, r"Expected a value of type 'Tensor' for argument"
85558555 r" '0' but instead found type 'Tuple\[Tensor,"):
85568556 @torch.jit.script
85578557 def bad_fn(x):
@@ -8626,13 +8626,13 @@ def method(self, x):
86268626 y = self.baz(x)
86278627 return x
86288628
8629- with self.assertRaisesRegex(RuntimeError, "expected at most 1 arguments but found 2"):
8629+ with self.assertRaisesRegex(RuntimeError, "Expected at most 1 arguments but found 2"):
86308630 ModuleTooMany()
8631- with self.assertRaisesRegex(RuntimeError, "argument 1 not provided"):
8631+ with self.assertRaisesRegex(RuntimeError, "Argument 1 not provided"):
86328632 ModuleTooFew()
86338633 with self.assertRaisesRegex(RuntimeError, "need 3 values .* found only 2"):
86348634 ModuleTooManyAssign()
8635- with self.assertRaisesRegex(RuntimeError, "argument 1 not provided."):
8635+ with self.assertRaisesRegex(RuntimeError, "Argument 1 not provided."):
86368636 ModuleDefault()
86378637
86388638 def test_script_define_order(self):
@@ -9462,12 +9462,12 @@ def foo(a, b):
94629462
94639463 def test_builtin_args_fails(self):
94649464
9465- with self.assertRaisesRegex(RuntimeError, 'expected at most'):
9465+ with self.assertRaisesRegex(RuntimeError, 'xpected at most'):
94669466 @torch.jit.script
94679467 def f0(a):
94689468 torch.sum(a, a, a, a)
94699469
9470- with self.assertRaisesRegex(RuntimeError, 'argument self not provided'):
9470+ with self.assertRaisesRegex(RuntimeError, 'Argument self not provided'):
94719471 @torch.jit.script
94729472 def f1(a):
94739473 torch.sum(foo=4)
@@ -9833,7 +9833,7 @@ def forward(self, x):
98339833 ReassignSelfRHS()
98349834
98359835 def test_unknown_builtin(self):
9836- with self.assertRaisesRegex(RuntimeError, 'unknown builtin op'):
9836+ with self.assertRaisesRegex(RuntimeError, 'Unknown builtin op'):
98379837 @torch.jit.script
98389838 def unknown_builtin(x):
98399839 return x.splork(3)
@@ -9916,7 +9916,7 @@ def multi_reduction(x):
99169916 ''')
99179917
99189918 def test_invalid_call_arguments(self):
9919- with self.assertRaisesRegex(RuntimeError, 'arguments for call are not valid'):
9919+ with self.assertRaisesRegex(RuntimeError, 'Arguments for call are not valid'):
99209920 @torch.jit.script
99219921 def invalid_call_arguments(x):
99229922 return torch.unsqueeze(3, 4, 5, 6, 7, 8)
@@ -10000,7 +10000,7 @@ def wrong_module_attr_lookup():
1000010000 return io.BytesIO
1000110001
1000210002 def test_wrong_method_call_inputs(self):
10003- with self.assertRaisesRegex(RuntimeError, 'argument y not provided'):
10003+ with self.assertRaisesRegex(RuntimeError, 'Argument y not provided'):
1000410004 class SomeModule(torch.jit.ScriptModule):
1000510005
1000610006 @torch.jit.script_method
@@ -10033,7 +10033,7 @@ def test():
1003310033 ''')
1003410034
1003510035 def test_call_ge(self):
10036- with self.assertRaisesRegex(RuntimeError, 'expected at most 1 arguments but found 3'):
10036+ with self.assertRaisesRegex(RuntimeError, 'Expected at most 1 arguments but found 3'):
1003710037 @_trace(torch.zeros(1, 2, 3))
1003810038 def foo(x):
1003910039 return x
@@ -10824,7 +10824,7 @@ def return_tup(x):
1082410824 return x, x # noqa: T484
1082510825
1082610826 def test_annotated_script_fn_arg_mismatch(self):
10827- with self.assertRaisesRegex(RuntimeError, r"arguments for call are not valid"):
10827+ with self.assertRaisesRegex(RuntimeError, r"Arguments for call are not valid"):
1082810828 @torch.jit.script
1082910829 def tuple_arg(x):
1083010830 # type: (Tuple[Tensor, Tensor]) -> Tensor
@@ -11318,7 +11318,7 @@ def forward(self, x):
1131811318 foo(torch.ones([123])) # wrong size
1131911319
1132011320 def test_builtin_error_messsage(self):
11321- with self.assertRaisesRegex(RuntimeError, "arguments for call are not valid"):
11321+ with self.assertRaisesRegex(RuntimeError, "Arguments for call are not valid"):
1132211322 @torch.jit.script
1132311323 def close_match(x):
1132411324 return x.masked_fill(True)
@@ -15644,7 +15644,7 @@ def set_non_initialized(self, y):
1564415644 self.bar = y # can't assign to non-initialized attr
1564515645
1564615646 def test_type_annotations(self):
15647- with self.assertRaisesRegex(RuntimeError, "expected a value of type \'bool"):
15647+ with self.assertRaisesRegex(RuntimeError, "Expected a value of type \'bool"):
1564815648 @torch.jit.script # noqa: B903
1564915649 class FooTest(object):
1565015650 def __init__(self, x):
0 commit comments