From 9bf2e13832fdfd62b9fcbb7adc2a01e233dce805 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 24 May 2019 11:04:47 +0200 Subject: [PATCH] test `conda install` in the default env in postBuild --- tests/conda/default-env/postBuild | 5 +++++ tests/conda/default-env/verify | 2 ++ tests/conda/default-env/verify.py | 13 +++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 tests/conda/default-env/postBuild create mode 100755 tests/conda/default-env/verify create mode 100755 tests/conda/default-env/verify.py diff --git a/tests/conda/default-env/postBuild b/tests/conda/default-env/postBuild new file mode 100644 index 00000000..980d00a0 --- /dev/null +++ b/tests/conda/default-env/postBuild @@ -0,0 +1,5 @@ +#!/bin/bash +# install pytest with conda in the default env (should be $KERNEL_PYTHON_PREFIX) +conda install -yq pytest +# install there with pip (should be the same) +pip install there diff --git a/tests/conda/default-env/verify b/tests/conda/default-env/verify new file mode 100755 index 00000000..058dbed0 --- /dev/null +++ b/tests/conda/default-env/verify @@ -0,0 +1,2 @@ +#!/bin/sh +pytest -v ./verify.py diff --git a/tests/conda/default-env/verify.py b/tests/conda/default-env/verify.py new file mode 100755 index 00000000..ef35812e --- /dev/null +++ b/tests/conda/default-env/verify.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +import os +import sys + + +def test_sys_prefix(): + # verify that pytest was installed in the notebook env + assert sys.prefix == os.environ["KERNEL_PYTHON_PREFIX"] + + +def test_there(): + # verify that there was installed in the notebook env + import there