     "execution_count": null,
     "metadata": {
      "collapsed": false
     },
     "outputs": [],
     "source": [
      "print('Push on empty stack, non-empty stack')\n",
      "stack = MyStack()\n",
      "stack.push(5)\n",
      "print('Push:', stack.peek(), 'Min after push:', stack.min())\n",
 
</s> remove     "print('Push on empty stack, non-empty stack')\n",
    "stack = MyStack()\n",
    "stack.push(5)\n",
    "print('Push:', stack.peek(), 'Min after push:', stack.min())\n",
    "stack.push(1)\n",
    "print('Push:', stack.peek(), 'Min after push:', stack.min())\n",
    "stack.push(3)\n",
    "print('Push:', stack.peek(), 'Min after push:', stack.min())\n",
    "stack.push(0)\n",
    "print('Push:', stack.peek(), 'Min after push:', stack.min())\n",
    "print('Pop on non-empty stack')\n",
    "print('Pop:', stack.pop(), 'Min after pop:', stack.min())\n",
    "print('Pop:', stack.pop(), 'Min after pop:', stack.min())\n",
    "print('Pop:', stack.pop(), 'Min after pop:', stack.min())\n",
    "print('Pop:', stack.pop(), 'Min after pop:', stack.min())\n",
    "print('Stack contents:', stack.peek())\n",
    "print('Pop empty stack:', stack.pop())"
 </s> add     "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_stack_min(self):\n",
    "        print('Test: Push on empty stack, non-empty stack')\n",
    "        stack = MyStack()\n",
    "        stack.push(5)\n",
    "        assert_equal(stack.peek(), 5)\n",
    "        assert_equal(stack.min(), 5)\n",
    "        stack.push(1)\n",
    "        assert_equal(stack.peek(), 1)\n",
    "        assert_equal(stack.min(), 1)\n",
    "        stack.push(3)\n",
    "        assert_equal(stack.peek(), 3)\n",
    "        assert_equal(stack.min(), 1)\n",
    "        stack.push(0)\n",
    "        assert_equal(stack.peek(), 0)\n",
    "        assert_equal(stack.min(), 0)\n",
    "\n",
    "        print('Test: Pop on non-empty stack')\n",
    "        assert_equal(stack.pop(), 0)\n",
    "        assert_equal(stack.min(), 1)\n",
    "        assert_equal(stack.pop(), 3)\n",
    "        assert_equal(stack.min(), 1)\n",
    "        assert_equal(stack.pop(), 1)\n",
    "        assert_equal(stack.min(), 5)\n",
    "        assert_equal(stack.pop(), 5)\n",
    "        assert_equal(stack.min(), sys.maxint)\n",
    "\n",
    "        print('Test: Pop empty stack')\n",
    "        assert_equal(stack.pop(), None)\n",
    "        \n",
    "        print('Success: test_stack_min')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_stack_min()" </s> remove    "execution_count": null,
 </s> add    "execution_count": 3, </s> remove    "execution_count": null,
 </s> add    "execution_count": 2, </s> remove    "execution_count": null,
 </s> add    "execution_count": 1,
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test: Push on empty stack, non-empty stack\n",
      "Test: Pop on non-empty stack\n",
      "Test: Pop empty stack\n",
      "Success: test_stack_min\n"
     ]
    }
   ],
     "execution_count": null,
     "metadata": {
      "collapsed": false
     },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test: Push on empty stack, non-empty stack\n",
      "Test: Pop on non-empty stack\n",
      "Test: Pop empty stack\n",
      "Success: test_stack_min\n"
     ]
    }
   ],
     "source": [
      "print('Push on empty stack, non-empty stack')\n",
      "stack = MyStack()\n",
      "stack.push(5)\n",
      "print('Push:', stack.peek(), 'Min after push:', stack.min())\n",
keep keep keep keep replace keep keep keep keep keep
 Reworked notebook: Added more detail to constraints and test cases.  Reworked unit test. 
stacks-queues/stack-min.ipynb