##// END OF EJS Templates
Don’t use ZeroDivisionError in tests...
Don’t use ZeroDivisionError in tests it’s not consistent across Python versions

File last commit:

r17093:0bf9f092
r17093:0bf9f092
Show More
Skip Exceptions.ipynb
54 lines | 1.4 KiB | text/plain | TextLexer
Julia Evans
Start adding tests from runipy
r17082 {
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
MinRK
Don’t use ZeroDivisionError in tests...
r17093 "raise Exception(\"message\")"
Julia Evans
Start adding tests from runipy
r17082 ],
"language": "python",
"metadata": {},
"outputs": [
{
MinRK
Don’t use ZeroDivisionError in tests...
r17093 "ename": "Exception",
"evalue": "message",
Julia Evans
Start adding tests from runipy
r17082 "output_type": "pyerr",
"traceback": [
MinRK
Don’t use ZeroDivisionError in tests...
r17093 "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mException\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-1-335814d14fc1>\u001b[0m in \u001b[0;36m<module>\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"
Julia Evans
Start adding tests from runipy
r17082 ]
}
],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
Julia Evans
print is a function in Python 3
r17089 "print('ok')"
Julia Evans
Start adding tests from runipy
r17082 ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"ok\n"
]
}
],
"prompt_number": 2
}
],
"metadata": {}
}
]
}