diff --git a/github/tests/Enterprise.py b/github/tests/Enterprise.py index d08a3464..9b0ea39b 100644 --- a/github/tests/Enterprise.py +++ b/github/tests/Enterprise.py @@ -28,10 +28,13 @@ class Enterprise(Framework.BasicTestCase): g = github.Github(self.login, self.password, base_url="http://my.enterprise.com") self.assertListKeyEqual(g.get_user().get_repos(), lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"]) - def testUnknownUrlScheme(self): - with self.assertRaises(AssertionError) as cm: + def testUnknownUrlScheme(self): # To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument + try: github.Github(self.login, self.password, base_url="foobar://my.enterprise.com") - self.assertEqual(cm.exception.args[0], "Unknown URL scheme") + except AssertionError, exception: + raised = True + self.assertEqual(exception.args[0], "Unknown URL scheme") + self.assertTrue(raised) def testLongUrl(self): g = github.Github(self.login, self.password, base_url="http://my.enterprise.com/path/to/github")