Merge pull request #22643 from edx/feanil/2to3_asserts

Run `2to3 -f asserts . -w` on edx-platform.
This commit is contained in:
Feanil Patel
2019-12-30 12:13:42 -05:00
committed by GitHub
214 changed files with 1459 additions and 1464 deletions

View File

@@ -113,11 +113,11 @@ class TransactionManagersTestCase(TransactionTestCase):
with outer_atomic():
atomic()(do_nothing)()
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot be inside an atomic block.'):
with atomic():
outer_atomic()(do_nothing)()
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot be inside an atomic block.'):
with outer_atomic():
outer_atomic()(do_nothing)()
@@ -134,11 +134,11 @@ class TransactionManagersTestCase(TransactionTestCase):
commit_on_success(read_committed=True)(do_nothing)()
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot change isolation level when nested.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot change isolation level when nested.'):
with commit_on_success():
commit_on_success(read_committed=True)(do_nothing)()
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot be inside an atomic block.'):
with atomic():
commit_on_success(read_committed=True)(do_nothing)()
@@ -162,7 +162,7 @@ class TransactionManagersTestCase(TransactionTestCase):
with atomic():
outer_atomic(name='pqr')(do_nothing)() # Not enabled.
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot be inside an atomic block.'):
with atomic():
outer_atomic(name='abc')(do_nothing)()
@@ -173,19 +173,19 @@ class TransactionManagersTestCase(TransactionTestCase):
with atomic():
outer_atomic(name='pqr')(do_nothing)() # Not enabled.
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot be inside an atomic block.'):
with atomic():
outer_atomic(name='def')(do_nothing)()
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot be inside an atomic block.'):
with outer_atomic():
outer_atomic(name='def')(do_nothing)()
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot be inside an atomic block.'):
with atomic():
outer_atomic(name='abc')(do_nothing)()
with self.assertRaisesRegexp(TransactionManagementError, 'Cannot be inside an atomic block.'):
with self.assertRaisesRegex(TransactionManagementError, 'Cannot be inside an atomic block.'):
with outer_atomic():
outer_atomic(name='abc')(do_nothing)()

View File

@@ -86,7 +86,7 @@ class KeywordSubTest(ModuleStoreTestCase):
test_string, self.context,
)
self.assertEquals(test_string, result)
self.assertEqual(test_string, result)
def test_should_not_sub(self):
"""
@@ -97,7 +97,7 @@ class KeywordSubTest(ModuleStoreTestCase):
test_string, self.context,
)
self.assertEquals(test_string, result)
self.assertEqual(test_string, result)
@file_data('fixtures/test_keywordsub_multiple_tags.json')
def test_sub_multiple_tags(self, test_string, expected):