diff --git a/graphs_trees/check_balance/check_balance_challenge.ipynb b/graphs_trees/check_balance/check_balance_challenge.ipynb index e29d7f4..9b87d0c 100644 --- a/graphs_trees/check_balance/check_balance_challenge.ipynb +++ b/graphs_trees/check_balance/check_balance_challenge.ipynb @@ -128,7 +128,7 @@ "\n", "class TestCheckBalance(object):\n", "\n", - " @raises(Exception)\n", + " @raises(TypeError)\n", " def test_check_balance_empty(self):\n", " bst = BstBalance(None)\n", " bst.check_balance()\n", diff --git a/graphs_trees/check_balance/check_balance_solution.ipynb b/graphs_trees/check_balance/check_balance_solution.ipynb index ed83414..f08f038 100644 --- a/graphs_trees/check_balance/check_balance_solution.ipynb +++ b/graphs_trees/check_balance/check_balance_solution.ipynb @@ -120,7 +120,7 @@ "\n", " def check_balance(self):\n", " if self.root is None:\n", - " raise Exception('No root node')\n", + " raise TypeError('root cannot be None')\n", " height = self._check_height(self.root)\n", " return height != -1" ] @@ -155,7 +155,7 @@ "\n", "class TestCheckBalance(object):\n", "\n", - " @raises(Exception)\n", + " @raises(TypeError)\n", " def test_check_balance_empty(self):\n", " bst = BstBalance(None)\n", " bst.check_balance()\n", diff --git a/graphs_trees/check_balance/test_check_balance.py b/graphs_trees/check_balance/test_check_balance.py index 831f96c..55bd223 100644 --- a/graphs_trees/check_balance/test_check_balance.py +++ b/graphs_trees/check_balance/test_check_balance.py @@ -4,7 +4,7 @@ from nose.tools import raises class TestCheckBalance(object): - @raises(Exception) + @raises(TypeError) def test_check_balance_empty(self): bst = BstBalance(None) bst.check_balance()