[2d4573]: / tutorials / run_tests.ipynb

Download this file

85 lines (85 with data), 2.4 kB

{
 "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.10"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python361064bit061169e3e2c44726897aa17d9d7ef2cc",
   "display_name": "Python 3.6.10 64-bit ('EHRKit': conda)"
  },
  "metadata": {
   "interpreter": {
    "hash": "1452ce364e145c8938a76e90050576b8a2a4d70ee75de50f3361ff243fa2a5f7"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "source": [
    "# Running Tests in EHRKit\n",
    "There are a number of directories which contain code which is not accessible inside these tutorials. For now, the best way to observe the effects of these tools is to use the unit tests in `tests/`"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "Unfortunately, you can't easily run tests in a jupyter notebook, so we will show you the code here to be run in bash, the results are in the tests folder. If you enter the tests folder you can run:"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "`python tests.py`"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "As you can see, out of the 10 tests that were run, 9 passed, and one failed. To run specific tests, and for more info on the tests, checkout the readme in the root directory: `EHRKit/tests/README.md`"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "Below is how you can run an individual test, unfortunately it cannot be done inside of a jupyter notebook, so we have laid out the code which can be run in bash:"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "`python tests.py t1.test1`"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "There are a number of other tests that one can run, the output from these tests is available in `tests/test_output.txt`, it has been pre-run to show the output. Please rerun to make sure that it works, you can run all the tests through `python tests/all_tests.py`"
   ],
   "cell_type": "markdown",
   "metadata": {}
  }
 ]
}