From 24ac74e6a707fdbca9299e1f1cfa80d4725f073a 2012-07-18 16:12:48 From: Bradley M. Froehle Date: 2012-07-18 16:12:48 Subject: [PATCH] Add test scripts for embed with compile flags. --- diff --git a/docs/examples/tests/embed/embed_division.py b/docs/examples/tests/embed/embed_division.py new file mode 100644 index 0000000..373846a --- /dev/null +++ b/docs/examples/tests/embed/embed_division.py @@ -0,0 +1,5 @@ +"""This tests that future compiler flags are passed to the embedded IPython.""" +from __future__ import division +from IPython import embed +embed(banner1='', header='check 1/2 == 0.5 in Python 2') +embed(banner1='', header='check 1/2 = 0 in Python 2', compile_flags=0) diff --git a/docs/examples/tests/embed/embed_no_division.py b/docs/examples/tests/embed/embed_no_division.py new file mode 100644 index 0000000..cdfd804 --- /dev/null +++ b/docs/examples/tests/embed/embed_no_division.py @@ -0,0 +1,6 @@ +"""This tests that future compiler flags are passed to the embedded IPython.""" +from IPython import embed +import __future__ +embed(banner1='', header='check 1/2 == 0 in Python 2') +embed(banner1='', header='check 1/2 == 0.5 in Python 2', + compile_flags=__future__.division.compiler_flag)