From 0bf9f092d33c2628381e9a8d544cc27c202c6b3a 2014-06-26 21:47:43 From: MinRK Date: 2014-06-26 21:47:43 Subject: [PATCH] Don’t use ZeroDivisionError in tests it’s not consistent across Python versions --- diff --git a/IPython/nbconvert/preprocessors/tests/expected/Skip Exceptions.ipynb b/IPython/nbconvert/preprocessors/tests/expected/Skip Exceptions.ipynb index 45503fe..278ee91 100644 --- a/IPython/nbconvert/preprocessors/tests/expected/Skip Exceptions.ipynb +++ b/IPython/nbconvert/preprocessors/tests/expected/Skip Exceptions.ipynb @@ -11,19 +11,19 @@ "cell_type": "code", "collapsed": false, "input": [ - "1 / 0" + "raise Exception(\"message\")" ], "language": "python", "metadata": {}, "outputs": [ { - "ename": "ZeroDivisionError", - "evalue": "integer division or modulo by zero", + "ename": "Exception", + "evalue": "message", "output_type": "pyerr", "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;36m1\u001b[0m \u001b[1;33m/\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero" + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mException\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"message\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mException\u001b[0m: message" ] } ], diff --git a/IPython/nbconvert/preprocessors/tests/input/Skip Exceptions.ipynb b/IPython/nbconvert/preprocessors/tests/input/Skip Exceptions.ipynb index 45503fe..278ee91 100644 --- a/IPython/nbconvert/preprocessors/tests/input/Skip Exceptions.ipynb +++ b/IPython/nbconvert/preprocessors/tests/input/Skip Exceptions.ipynb @@ -11,19 +11,19 @@ "cell_type": "code", "collapsed": false, "input": [ - "1 / 0" + "raise Exception(\"message\")" ], "language": "python", "metadata": {}, "outputs": [ { - "ename": "ZeroDivisionError", - "evalue": "integer division or modulo by zero", + "ename": "Exception", + "evalue": "message", "output_type": "pyerr", "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mZeroDivisionError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;36m1\u001b[0m \u001b[1;33m/\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;31mZeroDivisionError\u001b[0m: integer division or modulo by zero" + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mException\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mException\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"message\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mException\u001b[0m: message" ] } ],