#273: Remove nose dependency for online_judges/ (#282)

This commit is contained in:
Donne Martin
2020-07-14 21:34:08 -04:00
committed by GitHub
parent 67505c49b2
commit 46d3939632
60 changed files with 575 additions and 782 deletions

View File

@@ -82,9 +82,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"class Solution(object):\n",
@@ -115,20 +113,18 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"# %load test_math_ops.py\n",
"from nose.tools import assert_equal, assert_true, assert_raises\n",
"import unittest\n",
"\n",
"\n",
"class TestMathOps(object):\n",
"class TestMathOps(unittest.TestCase):\n",
"\n",
" def test_math_ops(self):\n",
" solution = Solution()\n",
" assert_raises(TypeError, solution.insert, None)\n",
" self.assertRaises(TypeError, solution.insert, None)\n",
" solution.insert(5)\n",
" solution.insert(2)\n",
" solution.insert(7)\n",
@@ -140,10 +136,10 @@
" solution.insert(3)\n",
" solution.insert(3)\n",
" solution.insert(2)\n",
" assert_equal(solution.max, 9)\n",
" assert_equal(solution.min, 2)\n",
" assert_equal(solution.mean, 5)\n",
" assert_true(solution.mode in (2, 92))\n",
" self.assertEqual(solution.max, 9)\n",
" self.assertEqual(solution.min, 2)\n",
" self.assertEqual(solution.mean, 5)\n",
" self.assertTrue(solution.mode in (2, 92))\n",
" print('Success: test_math_ops')\n",
"\n",
"\n",
@@ -182,9 +178,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
}