Browse Source

Merge pull request #2127 from blink1073/test-python-2

Test against python 2 and 3
S. Chris Colbert 8 years ago
parent
commit
97ce51f7d5
3 changed files with 26 additions and 10 deletions
  1. 15 8
      examples/notebook/test.ipynb
  2. 9 1
      scripts/travis_install.sh
  3. 2 1
      scripts/travis_script.sh

+ 15 - 8
examples/notebook/test.ipynb

@@ -34,11 +34,15 @@
    ],
    "source": [
     "import sys\n",
-    "print('hello world', flush=True)\n",
+    "sys.stdout.write('hello world\\n')\n",
+    "sys.stdout.flush()\n",
     "for i in range(3):\n",
-    "    print(i, flush=True)\n",
-    "print('output to stderr', file=sys.stderr, flush=True)\n",
-    "print('some more stdout text', flush=True)"
+    "    sys.stdout.write('%s\\n' % i)\n",
+    "    sys.stdout.flush()\n",
+    "sys.stderr.write('output to stderr\\n')\n",
+    "sys.stderr.flush()\n",
+    "sys.stdout.write('some more stdout text\\n')\n",
+    "sys.stdout.flush()"
    ]
   },
   {
@@ -145,14 +149,17 @@
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {},
+   "metadata": {
+    "collapsed": true
+   },
    "outputs": [],
    "source": []
   }
  ],
  "metadata": {
+  "anaconda-cloud": {},
   "kernelspec": {
-   "display_name": "Python 3",
+   "display_name": "Python [default]",
    "language": "python",
    "name": "python3"
   },
@@ -166,9 +173,9 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.4.4"
+   "version": "3.5.2"
   }
  },
  "nbformat": 4,
- "nbformat_minor": 0
+ "nbformat_minor": 1
 }

+ 9 - 1
scripts/travis_install.sh

@@ -5,7 +5,15 @@
 set -x
 
 npm update
-wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
+
+if [[ $GROUP == tests ]]; then
+    wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
+fi
+
+if [[ $GROUP == coverage ]]; then
+    wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
+fi
+
 bash miniconda.sh -b -p $HOME/miniconda
 export PATH="$HOME/miniconda/bin:$PATH"
 hash -r

+ 2 - 1
scripts/travis_script.sh

@@ -36,7 +36,8 @@ fi
 
 
 if [[ $GROUP == coverage ]]; then
-    # Run the coverage check.
+    # Run the coverage and python tests.
+    py.test
     npm run build
     npm run build:test
     npm run coverage