diff --git a/scipy-notebook/test/test_pandas.py b/scipy-notebook/test/test_pandas.py new file mode 100644 index 00000000..255027f3 --- /dev/null +++ b/scipy-notebook/test/test_pandas.py @@ -0,0 +1,27 @@ +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +import time +import logging + +import pytest + +LOGGER = logging.getLogger(__name__) + + +@pytest.mark.parametrize( + "name,command", + [ + ( + "Sum series", + "import pandas as pd; import numpy as np; np.random.seed(0); print(pd.Series(np.random.randint(0, 7, size=10)).sum())", + ), + ], +) +def test_pandas(container, name, command): + """Basic pandas tests""" + LOGGER.info(f"Testing pandas: {name} ...") + c = container.run(tty=True, command=["start.sh", "python", "-c", command]) + rv = c.wait(timeout=30) + assert rv == 0 or rv["StatusCode"] == 0 + logs = c.logs(stdout=True).decode("utf-8") + LOGGER.debug(logs) diff --git a/tensorflow-notebook/test/test_tensorflow.py b/tensorflow-notebook/test/test_tensorflow.py new file mode 100644 index 00000000..71d2c6d2 --- /dev/null +++ b/tensorflow-notebook/test/test_tensorflow.py @@ -0,0 +1,31 @@ +# Copyright (c) Jupyter Development Team. +# Distributed under the terms of the Modified BSD License. +import time +import logging + +import pytest + +LOGGER = logging.getLogger(__name__) + + +@pytest.mark.parametrize( + "name,command", + [ + ( + "Hello world", + "import tensorflow as tf;print(tf.constant('Hello, TensorFlow'))", + ), + ( + "Sum", + "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))", + ), + ], +) +def test_tensorflow(container, name, command): + """Basic tensorflow tests""" + LOGGER.info(f"Testing tensorflow: {name} ...") + c = container.run(tty=True, command=["start.sh", "python", "-c", command]) + rv = c.wait(timeout=30) + assert rv == 0 or rv["StatusCode"] == 0 + logs = c.logs(stdout=True).decode("utf-8") + LOGGER.debug(logs)