Skip to content

Commit 429d0e6

Browse files
committed
#273: Remove nose dependency for templates/
1 parent 0236a45 commit 429d0e6

File tree

3 files changed

+30
-38
lines changed

3 files changed

+30
-38
lines changed

templates/foo_challenge.ipynb

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@
6666
{
6767
"cell_type": "code",
6868
"execution_count": null,
69-
"metadata": {
70-
"collapsed": false
71-
},
69+
"metadata": {},
7270
"outputs": [],
7371
"source": [
7472
"def foo(val):\n",
@@ -93,9 +91,7 @@
9391
{
9492
"cell_type": "code",
9593
"execution_count": null,
96-
"metadata": {
97-
"collapsed": false
98-
},
94+
"metadata": {},
9995
"outputs": [],
10096
"source": [
10197
"%load test_foo.py"
@@ -113,23 +109,23 @@
113109
],
114110
"metadata": {
115111
"kernelspec": {
116-
"display_name": "Python 2",
112+
"display_name": "Python 3",
117113
"language": "python",
118-
"name": "python2"
114+
"name": "python3"
119115
},
120116
"language_info": {
121117
"codemirror_mode": {
122118
"name": "ipython",
123-
"version": 2
119+
"version": 3
124120
},
125121
"file_extension": ".py",
126122
"mimetype": "text/x-python",
127123
"name": "python",
128124
"nbconvert_exporter": "python",
129-
"pygments_lexer": "ipython2",
130-
"version": "2.7.10"
125+
"pygments_lexer": "ipython3",
126+
"version": "3.7.2"
131127
}
132128
},
133129
"nbformat": 4,
134-
"nbformat_minor": 0
130+
"nbformat_minor": 1
135131
}

templates/foo_solution.ipynb

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@
6969
{
7070
"cell_type": "code",
7171
"execution_count": 1,
72-
"metadata": {
73-
"collapsed": false
74-
},
72+
"metadata": {},
7573
"outputs": [],
7674
"source": [
7775
"def foo(val):\n",
@@ -88,9 +86,7 @@
8886
{
8987
"cell_type": "code",
9088
"execution_count": 2,
91-
"metadata": {
92-
"collapsed": false
93-
},
89+
"metadata": {},
9490
"outputs": [
9591
{
9692
"name": "stdout",
@@ -102,15 +98,15 @@
10298
],
10399
"source": [
104100
"%%writefile test_foo.py\n",
105-
"from nose.tools import assert_equal\n",
101+
"import unittest\n",
106102
"\n",
107103
"\n",
108-
"class TestFoo(object):\n",
104+
"class TestFoo(unittest.TestCase):\n",
109105
"\n",
110106
" def test_foo(self):\n",
111-
" assert_equal(foo(None), None)\n",
112-
" assert_equal(foo(0), 0)\n",
113-
" assert_equal(foo('bar'), 'bar')\n",
107+
" self.assertEqual(foo(None), None)\n",
108+
" self.assertEqual(foo(0), 0)\n",
109+
" self.assertEqual(foo('bar'), 'bar')\n",
114110
" print('Success: test_foo')\n",
115111
"\n",
116112
"\n",
@@ -126,9 +122,7 @@
126122
{
127123
"cell_type": "code",
128124
"execution_count": 3,
129-
"metadata": {
130-
"collapsed": false
131-
},
125+
"metadata": {},
132126
"outputs": [
133127
{
134128
"name": "stdout",
@@ -145,23 +139,23 @@
145139
],
146140
"metadata": {
147141
"kernelspec": {
148-
"display_name": "Python 2",
142+
"display_name": "Python 3",
149143
"language": "python",
150-
"name": "python2"
144+
"name": "python3"
151145
},
152146
"language_info": {
153147
"codemirror_mode": {
154148
"name": "ipython",
155-
"version": 2
149+
"version": 3
156150
},
157151
"file_extension": ".py",
158152
"mimetype": "text/x-python",
159153
"name": "python",
160154
"nbconvert_exporter": "python",
161-
"pygments_lexer": "ipython2",
162-
"version": "2.7.10"
155+
"pygments_lexer": "ipython3",
156+
"version": "3.7.2"
163157
}
164158
},
165159
"nbformat": 4,
166-
"nbformat_minor": 0
160+
"nbformat_minor": 1
167161
}

templates/test_foo.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
from nose.tools import assert_equal
1+
import unittest
22

33

4-
class TestFoo(object):
4+
class TestFoo(unittest.TestCase):
55

66
def test_foo(self):
7-
assert_equal(foo(None), None)
8-
assert_equal(foo(0), 0)
9-
assert_equal(foo('bar'), 'bar')
7+
self.assertEqual(foo(None), None)
8+
self.assertEqual(foo(0), 0)
9+
self.assertEqual(foo('bar'), 'bar')
1010
print('Success: test_foo')
1111

12+
1213
def main():
1314
test = TestFoo()
1415
test.test_foo()
1516

17+
1618
if __name__ == '__main__':
17-
main()
19+
main()

0 commit comments

Comments
 (0)