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)