#273: Remove nose dependency for graphs_trees/ (#277)

This commit is contained in:
Donne Martin
2020-07-10 21:02:32 -04:00
committed by GitHub
parent 139e157250
commit abf7524c26
67 changed files with 860 additions and 1027 deletions

View File

@@ -77,9 +77,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"metadata": {},
"outputs": [],
"source": [
"%run ../bst/bst.py"
@@ -88,9 +86,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"class BstHeight(Bst):\n",
@@ -112,9 +108,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
@@ -126,19 +120,19 @@
],
"source": [
"%%writefile test_height.py\n",
"from nose.tools import assert_equal\n",
"import unittest\n",
"\n",
"\n",
"class TestHeight(object):\n",
"class TestHeight(unittest.TestCase):\n",
"\n",
" def test_height(self):\n",
" bst = BstHeight(Node(5))\n",
" assert_equal(bst.height(bst.root), 1)\n",
" self.assertEqual(bst.height(bst.root), 1)\n",
" bst.insert(2)\n",
" bst.insert(8)\n",
" bst.insert(1)\n",
" bst.insert(3)\n",
" assert_equal(bst.height(bst.root), 3)\n",
" self.assertEqual(bst.height(bst.root), 3)\n",
"\n",
" print('Success: test_height')\n",
"\n",
@@ -155,9 +149,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
@@ -188,9 +180,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.0"
"version": "3.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}