Skip to content

Commit

Permalink
test: test when no kernel spec exists
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Jul 29, 2019
1 parent 5595d63 commit b6f0a0d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/app/no_kernelspec_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pytest


@pytest.fixture
def non_existing_kernel_notebook(base_url):
return base_url + "/voila/render/no_kernelspec.ipynb"


@pytest.fixture
def voila_args(notebook_directory, voila_args_extra):
return ['--VoilaTest.root_dir=%r' % notebook_directory] + voila_args_extra


@pytest.mark.gen_test
def test_non_existing_kernel(http_client, non_existing_kernel_notebook):
response = yield http_client.fetch(non_existing_kernel_notebook)
assert response.code == 200
assert 'Executing without a kernelspec' in response.body.decode('utf-8')
29 changes: 29 additions & 0 deletions tests/notebooks/no_kernelspec.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print('Executing without a kernelspec')"
]
}
],
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit b6f0a0d

Please sign in to comment.