8000 TestForeach::test_parity: Remove check for error message text (#134251) · pytorch/pytorch@55236d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 55236d0

Browse files
benjaminglass1pytorchmergebot
authored andcommitted
TestForeach::test_parity: Remove check for error message text (#134251)
Previously, error messages were expected to be string equivalent to error messages thrown by the ref function. This check fails for dozens of torch functions, and doesn't appear to add much value for the end user. This commit removes this check. Pull Request resolved: #134251 Approved by: https://github.com/amjames, https://github.com/janeyx99 ghstack dependencies: #134253, #134344
1 parent ef8c474 commit 55236d0

File tree

2 files changed

+1
-109
lines changed

2 files changed

+1
-109
lines changed

test/test_foreach.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,7 @@ def test_parity(self, device, dtype, op, noncontiguous, inplace):
229229
**sample.kwargs,
230230
)
231231
except Exception as e:
232-
with (
233-
self.assertRaisesRegex(type(e), re.escape(str(e).splitlines()[0]))
234-
if not (op.has_no_in_place or not op.supports_out)
235-
else self.assertRaises(type(e))
236-
):
232+
with self.assertRaises(type(e)):
237233
ref([ref_input, *sample.ref_args], **ref_kwargs)
238234
else:
239235
expected = ref([ref_input, *sample.ref_args], **ref_kwargs)

torch/testing/_internal/common_methods_invocations.py

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -10158,14 +10158,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1015810158
"test_meta_outplace",
1015910159
dtypes=complex_types_and(torch.bool),
1016010160
),
10161-
DecorateInfo(
10162-
unittest.expectedFailure,
10163-
"TestForeach",
10164-
"test_parity",
10165-
device_type="cuda",
10166-
dtypes=complex_types(),
10167-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10168-
),
1016910161
DecorateInfo(
1017010162
unittest.expectedFailure,
1017110163
"TestForeach",
@@ -10218,14 +10210,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1021810210
"test_meta_outplace",
1021910211
dtypes=complex_types(),
1022010212
),
10221-
DecorateInfo(
10222-
unittest.expectedFailure,
10223-
"TestForeach",
10224-
"test_parity",
10225-
device_type="cuda",
10226-
dtypes=complex_types(),
10227-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10228-
),
1022910213
DecorateInfo(
1023010214
unittest.expectedFailure,
1023110215
"TestForeach",
@@ -10278,14 +10262,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1027810262
"test_meta_outplace",
1027910263
dtypes=complex_types(),
1028010264
),
10281-
DecorateInfo(
10282-
unittest.expectedFailure,
10283-
"TestForeach",
10284-
"test_parity",
10285-
device_type="cuda",
10286-
dtypes=complex_types(),
10287-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10288-
),
1028910265
DecorateInfo(
1029010266
unittest.expectedFailure,
1029110267
"TestForeach",
@@ -10366,14 +10342,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1036610342
"test_meta_outplace",
1036710343
dtypes=complex_types_and(torch.bool),
1036810344
),
10369-
DecorateInfo(
10370-
unittest.expectedFailure,
10371-
"TestForeach",
10372-
"test_parity",
10373-
device_type="cuda",
10374-
dtypes=complex_types(),
10375-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10376-
),
1037710345
DecorateInfo(
1037810346
unittest.expectedFailure,
1037910347
"TestForeach",
@@ -10453,14 +10421,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1045310421
"test_meta_outplace",
1045410422
dtypes=complex_types_and(torch.bool),
1045510423
),
10456-
DecorateInfo(
10457-
unittest.expectedFailure,
10458-
"TestForeach",
10459-
"test_parity",
10460-
device_type="cuda",
10461-
dtypes=complex_types(),
10462-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10463-
),
1046410424
DecorateInfo(
1046510425
unittest.expectedFailure,
1046610426
"TestForeach",
@@ -10513,14 +10473,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1051310473
"test_meta_outplace",
1051410474
dtypes=integral_types_and(torch.bool) + complex_types(),
1051510475
),
10516-
DecorateInfo(
10517-
unittest.expectedFailure,
10518-
"TestForeach",
10519-
"test_parity",
10520-
device_type="cuda",
10521-
dtypes=complex_types(),
10522-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10523-
),
1052410476
DecorateInfo(
1052510477
unittest.expectedFailure,
1052610478
"TestForeach",
@@ -10629,14 +10581,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1062910581
"test_meta_outplace",
1063010582
dtypes=complex_types_and(torch.bool),
1063110583
),
10632-
DecorateInfo(
10633-
unittest.expectedFailure,
10634-
"TestForeach",
10635-
"test_parity",
10636-
device_type="cuda",
10637-
dtypes=complex_types(),
10638-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10639-
),
1064010584
DecorateInfo(
1064110585
unittest.expectedFailure,
1064210586
"TestForeach",
@@ -10762,14 +10706,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1076210706
"test_meta_outplace",
1076310707
dtypes=complex_types(),
1076410708
),
10765-
DecorateInfo(
10766-
unittest.expectedFailure,
10767-
"TestForeach",
10768-
"test_parity",
10769-
device_type="cuda",
10770-
dtypes=complex_types(),
10771-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10772-
),
1077310709
DecorateInfo(
1077410710
unittest.expectedFailure,
1077510711
"TestForeach",
@@ -10828,14 +10764,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1082810764
"test_meta_outplace",
1082910765
dtypes=complex_types(),
1083010766
),
10831-
DecorateInfo(
10832-
unittest.expectedFailure,
10833-
"TestForeach",
10834-
"test_parity",
10835-
device_type="cuda",
10836-
dtypes=complex_types(),
10837-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10838-
),
1083910767
DecorateInfo(
1084010768
unittest.expectedFailure,
1084110769
"TestForeach",
@@ -10946,14 +10874,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1094610874
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_meta_outplace"),
1094710875
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_dispatch_symbolic_meta_inplace_all_strides"),
1094810876
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_dispatch_symbolic_meta_outplace_all_strides"),
10949-
DecorateInfo(
10950-
unittest.expectedFailure,
10951-
"TestForeach",
10952-
"test_parity",
10953-
device_type="cuda",
10954-
dtypes=complex_types(),
10955-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10956-
),
1095710877
DecorateInfo(
1095810878
unittest.expectedFailure,
1095910879
"TestForeach",
@@ -10984,14 +10904,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1098410904
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_meta_outplace"),
1098510905
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_dispatch_symbolic_meta_inplace_all_strides"),
1098610906
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_dispatch_symbolic_meta_outplace_all_strides"),
10987-
DecorateInfo(
10988-
unittest.expectedFailure,
10989-
"TestForeach",
10990-
"test_parity",
10991-
device_type="cuda",
10992-
dtypes=complex_types(),
10993-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
10994-
),
1099510907
DecorateInfo(
1099610908
unittest.expectedFailure,
1099710909
"TestForeach",
@@ -11023,14 +10935,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1102310935
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_meta_outplace"),
1102410936
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_dispatch_symbolic_meta_inplace_all_strides"),
1102510937
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_dispatch_symbolic_meta_outplace_all_strides"),
11026-
DecorateInfo(
11027-
unittest.expectedFailure,
11028-
"TestForeach",
11029-
"test_parity",
11030-
device_type="cuda",
11031-
dtypes=complex_types(),
11032-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
11033-
),
1103410938
DecorateInfo(
1103510939
unittest.expectedFailure,
1103610940
"TestForeach",
@@ -11062,14 +10966,6 @@ def __call__(self, opinfo, device, dtype, requires_grad, **kwargs):
1106210966
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_meta_outplace"),
1106310967
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_dispatch_symbolic_meta_inplace_all_strides"),
1106410968
DecorateInfo(unittest.expectedFailure, "TestMeta", "test_dispatch_symbolic_meta_outplace_all_strides"),
11065-
DecorateInfo(
11066-
unittest.expectedFailure,
11067-
"TestForeach",
11068-
"test_parity",
11069-
device_type="cuda",
11070-
dtypes=complex_types(),
11071-
active_if=lambda kwargs: not kwargs.get("noncontiguous", False),
11072-
),
1107310969
DecorateInfo(
1107410970
unittest.expectedFailure,
1107510971
"TestForeach",

0 commit comments

Comments
 (0)
0