Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/framework/test/exceptions_test.py b/framework/test/exceptions_test.py
index 8fe2295..5013267 100644
--- a/framework/test/exceptions_test.py
+++ b/framework/test/exceptions_test.py
@@ -1,6 +1,6 @@
-# Copyright 2020 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
+# Copyright 2020 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Unittest for the exceptions module."""
from __future__ import print_function
@@ -21,7 +21,7 @@
err_aggregator.AddErrorMessage('The chickens are missing.')
err_aggregator.AddErrorMessage('The foxes are free.')
- with self.assertRaisesRegexp(
+ with self.assertRaisesRegex(
exceptions.InputException,
'The chickens are missing.\nThe foxes are free.'):
err_aggregator.RaiseIfErrors()
@@ -34,16 +34,16 @@
def testWithinContext_ExceptionPassedIn(self):
"""We do not suppress exceptions raised within wrapped code."""
- with self.assertRaisesRegexp(exceptions.InputException,
- 'We should raise this'):
+ with self.assertRaisesRegex(exceptions.InputException,
+ 'We should raise this'):
with exceptions.ErrorAggregator(exceptions.InputException) as errors:
errors.AddErrorMessage('We should ignore this error.')
raise exceptions.InputException('We should raise this')
def testWithinContext_NoExceptionPassedIn(self):
"""We raise an exception for any errors if no exceptions are passed in."""
- with self.assertRaisesRegexp(exceptions.InputException,
- 'We can raise this now.'):
+ with self.assertRaisesRegex(exceptions.InputException,
+ 'We can raise this now.'):
with exceptions.ErrorAggregator(exceptions.InputException) as errors:
errors.AddErrorMessage('We can raise this now.')
return True