-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a default kernel name for missing specs or non-existing kernels based on language
- Loading branch information
1 parent
2b657a6
commit 34718a2
Showing
6 changed files
with
166 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/non_existing_kernel.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 'non-existing kernel' in response.body.decode('utf-8') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"print('Executing with non-existing kernel')" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Xeus Python 2", | ||
"language": "python", | ||
"name": "xpython2" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython2", | ||
"version": "2.7.14" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters