mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix test_dispatch.py when running with TORCH_SHOW_CPP_STACKTRACES=1 (#50509)
Summary: `test_dispatch.py` has many asserts about the error message. When running with `TORCH_SHOW_CPP_STACKTRACES=1`, the error message is different from when `TORCH_SHOW_CPP_STACKTRACES=0`, which makes many tests in `test_dispatch.py` fail. This PR fixes these failures when running with `TORCH_SHOW_CPP_STACKTRACES=1`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/50509 Reviewed By: ngimel Differential Revision: D25956853 Pulled By: ezyang fbshipit-source-id: 3b3696742a7dfb8f52f23a364838ec96945c5662
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f1c578594b
commit
4f3cdd971c
@ -138,6 +138,7 @@ class TestDispatch(TestCase):
|
||||
if not expect_raises:
|
||||
raise
|
||||
actual = str(e).replace(test_namespace, "test")
|
||||
actual = actual.split("\nException raised from ")[0]
|
||||
expected, _, expected_provenance = results.setdefault(
|
||||
frozenset(active_ops),
|
||||
Result(actual, "", "error after running ctors {}".format(ctor_order[:i + 1]))
|
||||
|
||||
Reference in New Issue
Block a user