diff --git a/common/lib/capa/capa/safe_exec/tests/test_safe_exec.py b/common/lib/capa/capa/safe_exec/tests/test_safe_exec.py index e8f62159956b6d45c64f55418e38dfdf3a787164..68db41feec9c16220359919d83576fd17bbf08cf 100644 --- a/common/lib/capa/capa/safe_exec/tests/test_safe_exec.py +++ b/common/lib/capa/capa/safe_exec/tests/test_safe_exec.py @@ -77,7 +77,7 @@ class TestSafeExec(unittest.TestCase): # lint-amnesty, pylint: disable=missing- g = {} with pytest.raises(SafeExecException) as cm: safe_exec("1/0", g) - assert 'ZeroDivisionError' in text_type(cm.exception) + assert 'ZeroDivisionError' in text_type(cm.value) class TestSafeOrNot(unittest.TestCase): # lint-amnesty, pylint: disable=missing-class-docstring diff --git a/common/lib/capa/capa/tests/test_responsetypes.py b/common/lib/capa/capa/tests/test_responsetypes.py index ec7146d9d6a3276ad19b84767788e3cf5acaf848..bf1f9dcf31bd0dae8d6c63ac012a51dc76cad407 100644 --- a/common/lib/capa/capa/tests/test_responsetypes.py +++ b/common/lib/capa/capa/tests/test_responsetypes.py @@ -798,7 +798,7 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-class-docstri problem = self.build_problem(answer="a2", case_sensitive=False, regexp=True, additional_answers=['?\\d?']) with pytest.raises(Exception) as cm: self.assert_grade(problem, "a3", "correct") - exception_message = text_type(cm.exception) + exception_message = text_type(cm.value) assert 'nothing to repeat' in exception_message def test_hints(self): diff --git a/common/lib/xmodule/xmodule/tests/test_course_module.py b/common/lib/xmodule/xmodule/tests/test_course_module.py index 7d75c2d1268e75f125df5eeda1a6aa824d57d1f3..974ff7d07d84c53ee762a5a25ad2d414a2b36519 100644 --- a/common/lib/xmodule/xmodule/tests/test_course_module.py +++ b/common/lib/xmodule/xmodule/tests/test_course_module.py @@ -451,7 +451,7 @@ class ProctoringProviderTestCase(unittest.TestCase): with pytest.raises(ValueError) as context_manager: self.proctoring_provider.from_json(provider) - assert context_manager.exception.args[0] ==\ + assert context_manager.value.args[0] ==\ [f'The selected proctoring provider, {provider},' f' is not a valid provider. Please select from one of {allowed_proctoring_providers}.'] diff --git a/common/lib/xmodule/xmodule/tests/test_graders.py b/common/lib/xmodule/xmodule/tests/test_graders.py index 30995b5cf1ecfa6d31031f9a1fd87783bc365dd9..f8e88f81271003bd893a8d2fbd2ba20bbb820261 100644 --- a/common/lib/xmodule/xmodule/tests/test_graders.py +++ b/common/lib/xmodule/xmodule/tests/test_graders.py @@ -337,7 +337,7 @@ class GraderTest(unittest.TestCase): def test_grader_with_invalid_conf(self, invalid_conf, expected_error_message): with pytest.raises(ValueError) as error: graders.grader_from_conf([invalid_conf]) - assert expected_error_message in text_type(error.exception) + assert expected_error_message in text_type(error.value) @ddt.ddt