#273: Remove nose dependency for arrays_strings/ (#274)

This commit is contained in:
Donne Martin
2020-07-04 10:56:49 -04:00
committed by GitHub
parent 9678c5ee69
commit b598f474af
34 changed files with 399 additions and 481 deletions

View File

@@ -156,9 +156,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"class Solution(object):\n",
@@ -188,9 +186,7 @@
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
@@ -202,19 +198,19 @@
],
"source": [
"%%writefile test_two_sum.py\n",
"from nose.tools import assert_equal, assert_raises\n",
"import unittest\n",
"\n",
"\n",
"class TestTwoSum(object):\n",
"class TestTwoSum(unittest.TestCase):\n",
"\n",
" def test_two_sum(self):\n",
" solution = Solution()\n",
" assert_raises(TypeError, solution.two_sum, None, None)\n",
" assert_raises(ValueError, solution.two_sum, [], 0)\n",
" self.assertRaises(TypeError, solution.two_sum, None, None)\n",
" self.assertRaises(ValueError, solution.two_sum, [], 0)\n",
" target = 7\n",
" nums = [1, 3, 2, -7, 5]\n",
" expected = [2, 4]\n",
" assert_equal(solution.two_sum(nums, target), expected)\n",
" self.assertEqual(solution.two_sum(nums, target), expected)\n",
" print('Success: test_two_sum')\n",
"\n",
"\n",
@@ -230,9 +226,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
@@ -263,9 +257,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
}