Skip to content

Commit

Permalink
Avoid deprecation warning due to renamed assertion method in Py3.2+
Browse files Browse the repository at this point in the history
  • Loading branch information
lelit committed Dec 3, 2015
1 parent 4c0ef6e commit b1e3eaf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dulwich/tests/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,13 @@ def test_getitem_unicode(self):
for k, contained in test_keys:
self.assertEqual(k in r, contained)

# Avoid deprecation warning under Py3.2+
if hasattr(self, 'assertRaisesRegex'):
assertRaisesRegexp = self.assertRaisesRegex
else:
assertRaisesRegexp = self.assertRaisesRegexp
for k, _ in test_keys:
self.assertRaisesRegexp(
assertRaisesRegexp(
TypeError, "'name' must be bytestring, not int",
r.__getitem__, 12
)
Expand Down

0 comments on commit b1e3eaf

Please sign in to comment.