{"issue":{"created_at":"2011-12-13T08:40:24Z","state":"open","updated_at":"2011-12-13T08:40:24Z","user":{"gravatar_id":"2282252d89ba3869c9c1d2ac82ede44c","id":933552,"url":"https://api.github.com/users/davidalber","login":"davidalber","avatar_url":"https://secure.gravatar.com/avatar/2282252d89ba3869c9c1d2ac82ede44c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":0,"body":"A number of tests are written to verify an expected exception is raised and that its message matches what is expected. These tests are currently using `assertRaises` and a subsequent try-except block. Example:\r\n\r\n    self.assertRaises(DuplicateNodeError, self.graph1.add_node,\r\n                      \"Leonhard Euler\", \"Universitaet Basel\",\r\n                      1726, 38586, set(), set())\r\n\r\n    try:\r\n        self.graph1.add_node(\"Leonhard Euler\", \"Universitaet Basel\",\r\n                             1726, 38586, set(), set())\r\n    except DuplicateNodeError as e:\r\n        self.assertEqual(str(e),\r\n                         \"node with id {} already exists\".format(38586))\r\n    else:\r\n        self.fail()\r\n\r\nThis can be improved by using [`assertRaisesRegexp`](http://docs.python.org/library/unittest.html#unittest.TestCase.assertRaisesRegexp).","assignee":{"gravatar_id":"2282252d89ba3869c9c1d2ac82ede44c","id":933552,"url":"https://api.github.com/users/davidalber","login":"davidalber","avatar_url":"https://secure.gravatar.com/avatar/2282252d89ba3869c9c1d2ac82ede44c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2534173,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"name":"Task","color":"02d7e1","url":"https://api.github.com/repos/davidalber/Geneagrapher/labels/Task"}],"number":13,"title":"Use assertRaisesRegexp","closed_at":null,"html_url":"https://github.com/davidalber/Geneagrapher/issues/13","url":"https://api.github.com/repos/davidalber/Geneagrapher/issues/13","milestone":{"created_at":"2011-11-28T06:57:17Z","state":"open","closed_issues":7,"due_on":null,"creator":{"gravatar_id":"2282252d89ba3869c9c1d2ac82ede44c","id":933552,"url":"https://api.github.com/users/davidalber","login":"davidalber","avatar_url":"https://secure.gravatar.com/avatar/2282252d89ba3869c9c1d2ac82ede44c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"number":1,"title":"Version 1","description":"","url":"https://api.github.com/repos/davidalber/Geneagrapher/milestones/1","open_issues":5}},"action":"opened"}