Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Install xeus-python kernelspec for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Aug 27, 2019
1 parent 82e1bed commit 416873f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -39,8 +39,6 @@ XEUS_LOG=1 jupyter lab --no-browser --watch

### Tests

Make sure `xeus-python` is installed and `jupyter --paths` points to where the kernel is installed.

To run the tests:

```bash
Expand Down
1 change: 0 additions & 1 deletion azure-pipelines.yml
Expand Up @@ -28,7 +28,6 @@ steps:

- bash: |
source activate jupyterlab-debugger
export JUPYTER_PATH=${CONDA_PREFIX}/share/jupyter
export XEUS_LOG=1
jlpm run test
displayName: Run the tests
Expand Down
28 changes: 27 additions & 1 deletion tests/run-test.py
@@ -1,10 +1,36 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

import json
import os
from jupyterlab.tests.test_app import run_jest
from os.path import join as pjoin

from jupyter_core import paths
from jupyterlab.tests.test_app import run_jest, JestApp

HERE = os.path.realpath(os.path.dirname(__file__))


def _install_xpython_kernel():
# Mimics: https://github.com/jupyterlab/jupyterlab/blob/cd2fb6ac3ecfae2bb4bcab84797932e625e9bb2f/jupyterlab/tests/test_app.py#L80-L95
kernel_json = {
'argv': [
'xpython',
'-f', '{connection_file}'
],
'display_name': "xpython",
'language': 'python'
}
kernel_dir = pjoin(paths.jupyter_data_dir(), 'kernels', 'xpython')
os.makedirs(kernel_dir)
with open(pjoin(kernel_dir, 'kernel.json'), 'w') as f:
f.write(json.dumps(kernel_json))


if __name__ == '__main__':
jest_app = JestApp.instance()

# install the kernel spec for xeus-python
_install_xpython_kernel()

run_jest(HERE)

0 comments on commit 416873f

Please sign in to comment.