[damned-lies] Updated deprecated test assertions
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Updated deprecated test assertions
- Date: Thu, 23 Feb 2017 21:36:46 +0000 (UTC)
commit b06ab3d8915d162ba7d7af41ded5c84c0212102e
Author: Claude Paroz <claude 2xlibre net>
Date: Thu Feb 23 21:17:18 2017 +0100
Updated deprecated test assertions
stats/tests/tests.py | 2 +-
teams/tests.py | 12 ++++++------
vertimus/tests/tests.py | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/stats/tests/tests.py b/stats/tests/tests.py
index 025cfcb..e7498cf 100644
--- a/stats/tests/tests.py
+++ b/stats/tests/tests.py
@@ -327,7 +327,7 @@ class ModuleTestCase(TestCase):
po_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'test.po')
domain = self.mod.domain_set.get(name='po')
fr_lang = Language.objects.get(locale='fr')
- with self.assertRaisesRegexp(Exception, 'read-only mode'):
+ with self.assertRaisesRegex(Exception, 'read-only mode'):
branch.commit_po(po_file, domain, fr_lang, 'Author <someone example org>')
self.mod.vcs_root = self.mod.vcs_root.replace('git://', 'ssh://')
self.mod.save()
diff --git a/teams/tests.py b/teams/tests.py
index da10003..97c54b4 100644
--- a/teams/tests.py
+++ b/teams/tests.py
@@ -82,15 +82,15 @@ class TeamTest(TeamsAndRolesTests):
self.assertEqual(pcoords[0], self.pcoo)
members = team.get_committers_exact()
- self.assert_(len(members), 1)
+ self.assertEqual(len(members), 1)
self.assertEqual(members[0], self.pc)
members = team.get_reviewers_exact()
- self.assert_(len(members), 1)
+ self.assertEqual(len(members), 1)
self.assertEqual(members[0], self.pr)
members = team.get_translators_exact()
- self.assert_(len(members), 1)
+ self.assertEqual(len(members), 1)
self.assertEqual(members[0], self.pt)
def test_roles_exact(self):
@@ -109,17 +109,17 @@ class TeamTest(TeamsAndRolesTests):
members = team.get_committers()
self.assertEqual(len(members), 2)
for pc in members:
- self.assert_(pc in [self.pcoo, self.pc])
+ self.assertTrue(pc in [self.pcoo, self.pc])
members = team.get_reviewers()
self.assertEqual(len(members), 3)
for pc in members:
- self.assert_(pc in [self.pcoo, self.pc, self.pr])
+ self.assertTrue(pc in [self.pcoo, self.pc, self.pr])
members = team.get_translators()
self.assertEqual(len(members), 4)
for pc in members:
- self.assert_(pc in [self.pcoo, self.pc, self.pr, self.pt])
+ self.assertTrue(pc in [self.pcoo, self.pc, self.pr, self.pt])
def test_roles(self):
self.run_roles_test(self.t)
diff --git a/vertimus/tests/tests.py b/vertimus/tests/tests.py
index 8cdbce7..06fe49c 100644
--- a/vertimus/tests/tests.py
+++ b/vertimus/tests/tests.py
@@ -671,8 +671,8 @@ class VertimusTest(TeamsAndRolesTests):
actions_db = Action.objects.filter(state_db__id=state.id).exclude(name='WC').order_by('-id')
# So the last action is UNDO
- self.assert_(isinstance(actions_db[0], ActionUNDO))
+ self.assertIsInstance(actions_db[0], ActionUNDO)
# Here be dragons! A call to len() workaround the Django/MySQL bug!
len(actions_db)
- self.assert_(isinstance(actions_db[0], ActionUNDO))
+ self.assertIsInstance(actions_db[0], ActionUNDO)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]