Skip to content

Commit 291cf7b

Browse files
committed
Update on "[ExecuTorch] Arm Ethos: Do not depend on torch.testing._internal "
This can cuase issues with `disable_global_flags` and internal state of the library, this is something which is set when importing this. Differential Revision: [D70402061](https://our.internmc.facebook.com/intern/diff/D70402061/) [ghstack-poisoned]
2 parents 7411eb5 + d2d2ece commit 291cf7b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

backends/arm/test/passes/test_rescale_pass.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from executorch.backends.arm.test.tester.arm_tester import ArmTester
1515
from parameterized import parameterized
1616

17-
class OpCheckError(Exception):
18-
pass
1917

2018
def test_rescale_op():
2119
sample_inputs = [
@@ -65,7 +63,7 @@ def test_nonzero_zp_for_int32():
6563
),
6664
]
6765
for sample_input in sample_inputs:
68-
with pytest.raises(OpCheckError):
66+
with pytest.raises(Exception, match="OpCheckError"):
6967
torch.library.opcheck(torch.ops.tosa._rescale, sample_input)
7068

7169

@@ -88,7 +86,7 @@ def test_zp_outside_range():
8886
),
8987
]
9088
for sample_input in sample_inputs:
91-
with pytest.raises(OpCheckError):
89+
with pytest.raises(Exception, match="OpCheckError"):
9290
torch.library.opcheck(torch.ops.tosa._rescale, sample_input)
9391

9492

0 commit comments

Comments
 (0)