File tree 2 files changed +17
-14
lines changed
notebooks/beginner/exercises
2 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 6
6
"metadata" : {},
7
7
"outputs" : [],
8
8
"source" : [
9
- " # Required boilerplate\n " ,
9
+ " # Let's make sure pytest and ipytest packages are installed\n " ,
10
+ " # ipytest is required for running pytest inside Jupyter notebooks\n " ,
10
11
" import sys\n " ,
11
12
" \n " ,
12
13
" !{sys.executable} -m pip install pytest\n " ,
13
14
" !{sys.executable} -m pip install ipytest\n " ,
14
15
" \n " ,
15
- " import ipytest.magics \n " ,
16
- " import pytest \n " ,
16
+ " # These are needed for running pytest inside Jupyter notebooks \n " ,
17
+ " import ipytest \n " ,
17
18
" \n " ,
18
- " __file__ = \" testing1_exercise.ipynb \" "
19
+ " ipytest.autoconfig() "
19
20
]
20
21
},
21
22
{
50
51
"metadata" : {},
51
52
"outputs" : [],
52
53
"source" : [
53
- " %%run_pytest[clean] \n " ,
54
+ " %%ipytest \n " ,
54
55
" \n " ,
55
56
" def test_get_divisible_by_five():\n " ,
56
57
" # Your implementation here\n "
59
60
],
60
61
"metadata" : {
61
62
"kernelspec" : {
62
- "display_name" : " Python 3" ,
63
+ "display_name" : " Python 3 (ipykernel) " ,
63
64
"language" : " python" ,
64
65
"name" : " python3"
65
66
},
73
74
"name" : " python" ,
74
75
"nbconvert_exporter" : " python" ,
75
76
"pygments_lexer" : " ipython3" ,
76
- "version" : " 3.5.4 "
77
+ "version" : " 3.11.0 "
77
78
}
78
79
},
79
80
"nbformat" : 4 ,
Original file line number Diff line number Diff line change 6
6
"metadata" : {},
7
7
"outputs" : [],
8
8
"source" : [
9
- " # Required boilerplate\n " ,
9
+ " # Let's make sure pytest and ipytest packages are installed\n " ,
10
+ " # ipytest is required for running pytest inside Jupyter notebooks\n " ,
10
11
" import sys\n " ,
11
12
" \n " ,
12
13
" !{sys.executable} -m pip install pytest\n " ,
13
14
" !{sys.executable} -m pip install ipytest\n " ,
14
15
" \n " ,
15
- " import ipytest.magics\n " ,
16
+ " # These are needed for running pytest inside Jupyter notebooks\n " ,
17
+ " import ipytest\n " ,
16
18
" import pytest\n " ,
17
19
" \n " ,
18
- " __file__ = \" testing2_exercise.ipynb \" "
20
+ " ipytest.autoconfig() "
19
21
]
20
22
},
21
23
{
83
85
"metadata" : {},
84
86
"outputs" : [],
85
87
"source" : [
86
- " %%run_pytest[clean] \n " ,
88
+ " %%ipytest \n " ,
87
89
" \n " ,
88
90
" \n " ,
89
91
" @pytest.____\n " ,
171
173
"metadata" : {},
172
174
"outputs" : [],
173
175
"source" : [
174
- " %%run_pytest[clean] \n " ,
176
+ " %%ipytest \n " ,
175
177
" \n " ,
176
178
" # Your implementation here\n "
177
179
]
178
180
}
179
181
],
180
182
"metadata" : {
181
183
"kernelspec" : {
182
- "display_name" : " Python 3" ,
184
+ "display_name" : " Python 3 (ipykernel) " ,
183
185
"language" : " python" ,
184
186
"name" : " python3"
185
187
},
193
195
"name" : " python" ,
194
196
"nbconvert_exporter" : " python" ,
195
197
"pygments_lexer" : " ipython3" ,
196
- "version" : " 3.5.4 "
198
+ "version" : " 3.11.0 "
197
199
}
198
200
},
199
201
"nbformat" : 4 ,
You can’t perform that action at this time.
0 commit comments