diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py b/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py index 88940ace83..12302f5a69 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_git_export.py @@ -105,8 +105,7 @@ class TestGitExport(CourseTestCase): with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.URL_BAD)): git_export_utils.export_to_git(course_key, 'example.com:edx/notreal') - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.URL_NO_AUTH)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.URL_NO_AUTH)): git_export_utils.export_to_git(course_key, 'http://blah') def test_bad_git_repos(self): @@ -117,23 +116,20 @@ class TestGitExport(CourseTestCase): self.assertFalse(os.path.isdir(test_repo_path)) course_key = CourseLocator('foo', 'blah', '100-') # Test bad clones - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.CANNOT_PULL)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.CANNOT_PULL)): git_export_utils.export_to_git( course_key, 'https://user:blah@example.com/test_repo.git') self.assertFalse(os.path.isdir(test_repo_path)) # Setup good repo with bad course to test xml export - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.XML_EXPORT_FAIL)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.XML_EXPORT_FAIL)): git_export_utils.export_to_git( course_key, 'file://{0}'.format(self.bare_repo_dir)) # Test bad git remote after successful clone - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.CANNOT_PULL)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.CANNOT_PULL)): git_export_utils.export_to_git( course_key, 'https://user:blah@example.com/r.git') @@ -189,7 +185,6 @@ class TestGitExport(CourseTestCase): 'file://{0}'.format(self.bare_repo_dir) ) - with self.assertRaisesRegex(GitExportError, - six.text_type(GitExportError.CANNOT_COMMIT)): + with self.assertRaisesRegex(GitExportError, six.text_type(GitExportError.CANNOT_COMMIT)): git_export_utils.export_to_git( self.course.id, 'file://{0}'.format(self.bare_repo_dir)) diff --git a/cms/djangoapps/contentstore/tests/test_utils.py b/cms/djangoapps/contentstore/tests/test_utils.py index 03c3378883..eeba617e4b 100644 --- a/cms/djangoapps/contentstore/tests/test_utils.py +++ b/cms/djangoapps/contentstore/tests/test_utils.py @@ -28,7 +28,7 @@ class LMSLinksTestCase(TestCase): location = course_key.make_usage_key('vertical', 'contacting_us') link = utils.get_lms_link_for_item(location, False) self.assertEqual(link, "//localhost:8000/courses/course-v1:mitX+101+test/jump_to/block-v1:mitX+101+test+type" - "@vertical+block@contacting_us") + "@vertical+block@contacting_us") # test preview link = utils.get_lms_link_for_item(location, True) @@ -42,7 +42,7 @@ class LMSLinksTestCase(TestCase): location = course_key.make_usage_key('course', 'test') link = utils.get_lms_link_for_item(location) self.assertEqual(link, "//localhost:8000/courses/course-v1:mitX+101+test/jump_to/block-v1:mitX+101+test+type" - "@course+block@test") + "@course+block@test") def lms_link_for_certificate_web_view_test(self): """ Tests get_lms_link_for_certificate_web_view. """ diff --git a/cms/djangoapps/contentstore/views/tests/test_item.py b/cms/djangoapps/contentstore/views/tests/test_item.py index e25f03b8dd..1de35c6deb 100644 --- a/cms/djangoapps/contentstore/views/tests/test_item.py +++ b/cms/djangoapps/contentstore/views/tests/test_item.py @@ -2194,7 +2194,7 @@ class TestComponentHandler(TestCase): self.descriptor.handle = create_response self.assertEqual(component_handler(self.request, self.usage_key_string, 'dummy_handler').status_code, - status_code) + status_code) @ddt.data((True, True), (False, False),) @ddt.unpack diff --git a/common/lib/capa/capa/tests/test_responsetypes.py b/common/lib/capa/capa/tests/test_responsetypes.py index 0aa237549b..486778a4e4 100644 --- a/common/lib/capa/capa/tests/test_responsetypes.py +++ b/common/lib/capa/capa/tests/test_responsetypes.py @@ -481,13 +481,13 @@ class FormulaResponseTest(ResponseTest): input_dict = {'1_2_1': "x + 2*y + y"} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - 'Check the coefficient of y') + 'Check the coefficient of y') # Expect to receive a hint if we leave out x input_dict = {'1_2_1': "2*y"} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - 'Try including the variable x') + 'Try including the variable x') def test_script(self): """ @@ -819,13 +819,13 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring input_dict = {'1_2_1': 'Wisconsin'} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - "The state capital of Wisconsin is Madison") + "The state capital of Wisconsin is Madison") # We should get a hint for Minnesota input_dict = {'1_2_1': 'Minnesota'} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - "The state capital of Minnesota is St. Paul") + "The state capital of Minnesota is St. Paul") # We should NOT get a hint for Michigan (the correct answer) input_dict = {'1_2_1': 'Michigan'} @@ -868,13 +868,13 @@ class StringResponseTest(ResponseTest): # pylint: disable=missing-docstring input_dict = {'1_2_1': 'Wisconsin'} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - "The state capital of Wisconsin is Madison") + "The state capital of Wisconsin is Madison") # We should get a hint for Minnesota input_dict = {'1_2_1': 'Minnesota'} correct_map = problem.grade_answers(input_dict) self.assertEqual(correct_map.get_hint('1_2_1'), - "The state capital of Minnesota is St. Paul") + "The state capital of Minnesota is St. Paul") # We should NOT get a hint for Michigan (the correct answer) input_dict = {'1_2_1': 'Michigan'} diff --git a/common/lib/capa/capa/tests/test_shuffle.py b/common/lib/capa/capa/tests/test_shuffle.py index 6a7cd567de..22a3ee9498 100644 --- a/common/lib/capa/capa/tests/test_shuffle.py +++ b/common/lib/capa/capa/tests/test_shuffle.py @@ -279,7 +279,7 @@ class CapaShuffleTest(unittest.TestCase): html = orig_html.replace('\n', ' ') # avoid headaches with .* matching print(html) self.assertRegex(html, r"