Skip to content

Commit 97e08a4

Browse files
committed
assertraisesregex
1 parent 5ce8ae9 commit 97e08a4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

onnxscript/version_converter/_version_converter_test.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,14 +506,11 @@ def test_version_convert_raises_on_function_node_with_ref_attribute(self):
506506
)
507507

508508
target_version = 20
509-
with self.assertRaises(
509+
with self.assertRaisesRegex(
510510
version_converter._version_converter.VersionConverterError, # pylint: disable=protected-access
511-
) as ctx:
512-
version_converter.convert_version(model, target_version=target_version)
513-
self.assertRegex(
514-
str(ctx.exception),
515511
"has ref attribute, which is not supported by version converter",
516-
)
512+
):
513+
version_converter.convert_version(model, target_version=target_version)
517514

518515

519516
class VersionConverter25to26Test(unittest.TestCase):

0 commit comments

Comments
 (0)