Skip to content

Commit 407dc6d

Browse files
committed
Update ipytest things
1 parent 5befce8 commit 407dc6d

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

notebooks/beginner/exercises/08_testing1_exercise.ipynb

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
"metadata": {},
77
"outputs": [],
88
"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",
1011
"import sys\n",
1112
"\n",
1213
"!{sys.executable} -m pip install pytest\n",
1314
"!{sys.executable} -m pip install ipytest\n",
1415
"\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",
1718
"\n",
18-
"__file__ = \"testing1_exercise.ipynb\""
19+
"ipytest.autoconfig()"
1920
]
2021
},
2122
{
@@ -50,7 +51,7 @@
5051
"metadata": {},
5152
"outputs": [],
5253
"source": [
53-
"%%run_pytest[clean]\n",
54+
"%%ipytest\n",
5455
"\n",
5556
"def test_get_divisible_by_five():\n",
5657
" # Your implementation here\n"
@@ -59,7 +60,7 @@
5960
],
6061
"metadata": {
6162
"kernelspec": {
62-
"display_name": "Python 3",
63+
"display_name": "Python 3 (ipykernel)",
6364
"language": "python",
6465
"name": "python3"
6566
},
@@ -73,7 +74,7 @@
7374
"name": "python",
7475
"nbconvert_exporter": "python",
7576
"pygments_lexer": "ipython3",
76-
"version": "3.5.4"
77+
"version": "3.11.0"
7778
}
7879
},
7980
"nbformat": 4,

notebooks/beginner/exercises/16_testing2_exercise.ipynb

+9-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@
66
"metadata": {},
77
"outputs": [],
88
"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",
1011
"import sys\n",
1112
"\n",
1213
"!{sys.executable} -m pip install pytest\n",
1314
"!{sys.executable} -m pip install ipytest\n",
1415
"\n",
15-
"import ipytest.magics\n",
16+
"# These are needed for running pytest inside Jupyter notebooks\n",
17+
"import ipytest\n",
1618
"import pytest\n",
1719
"\n",
18-
"__file__ = \"testing2_exercise.ipynb\""
20+
"ipytest.autoconfig()"
1921
]
2022
},
2123
{
@@ -83,7 +85,7 @@
8385
"metadata": {},
8486
"outputs": [],
8587
"source": [
86-
"%%run_pytest[clean]\n",
88+
"%%ipytest\n",
8789
"\n",
8890
"\n",
8991
"@pytest.____\n",
@@ -171,15 +173,15 @@
171173
"metadata": {},
172174
"outputs": [],
173175
"source": [
174-
"%%run_pytest[clean]\n",
176+
"%%ipytest\n",
175177
"\n",
176178
"# Your implementation here\n"
177179
]
178180
}
179181
],
180182
"metadata": {
181183
"kernelspec": {
182-
"display_name": "Python 3",
184+
"display_name": "Python 3 (ipykernel)",
183185
"language": "python",
184186
"name": "python3"
185187
},
@@ -193,7 +195,7 @@
193195
"name": "python",
194196
"nbconvert_exporter": "python",
195197
"pygments_lexer": "ipython3",
196-
"version": "3.5.4"
198+
"version": "3.11.0"
197199
}
198200
},
199201
"nbformat": 4,

0 commit comments

Comments
 (0)