Skip to content

Commit 598859d

Browse files
committed
✅ Add a test
1 parent ffaff4a commit 598859d

3 files changed

Lines changed: 36 additions & 1 deletion

File tree

docs/guide/received.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"cell_type": "markdown",
3030
"metadata": {},
3131
"source": [
32-
"The header now makes package verion mismatches evident. "
32+
"The header now makes package version mismatches evident. "
3333
]
3434
},
3535
{

tests/for-nbconvert.ipynb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"from nbproject.dev._jupyter_communicate import notebook_path\n",
10+
"\n",
11+
"assert notebook_path() is not None, \"Cannot infer notebook path.\""
12+
]
13+
}
14+
],
15+
"metadata": {
16+
"language_info": {
17+
"name": "python"
18+
}
19+
},
20+
"nbformat": 4,
21+
"nbformat_minor": 2
22+
}

tests/test_nbconvert.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import subprocess
2+
from pathlib import Path
3+
4+
5+
def test_running_via_nbconvert():
6+
result = subprocess.run(
7+
"jupyter nbconvert --to notebook --execute ./tests/for-nbconvert.ipynb",
8+
shell=True,
9+
capture_output=True,
10+
)
11+
print(result.stdout.decode())
12+
print(result.stderr.decode())
13+
assert result.returncode == 0

0 commit comments

Comments
 (0)