diff --git a/IPython/testing/plugin/dtexample.py b/IPython/testing/plugin/dtexample.py index d09ed2c..304de65 100644 --- a/IPython/testing/plugin/dtexample.py +++ b/IPython/testing/plugin/dtexample.py @@ -17,10 +17,10 @@ def pyfunc(): 5 >>> for i in range(3): - ... print i, - ... print i+1, + ... print(i, end=' ') + ... print(i+1, end=' ') ... - 0 1 1 2 2 3 + 0 1 1 2 2 3 """ return 'pyfunc' @@ -34,10 +34,10 @@ def ipfunc(): Out[3]: 5 In [26]: for i in range(3): - ....: print i, - ....: print i+1, + ....: print(i, end=' ') + ....: print(i+1, end=' ') ....: - 0 1 1 2 2 3 + 0 1 1 2 2 3 Examples that access the operating system work: @@ -59,7 +59,7 @@ def ipfunc(): In [7]: 'hi' Out[7]: 'hi' - In [8]: print repr(_) + In [8]: print(repr(_)) 'hi' In [7]: 3+4 @@ -135,7 +135,7 @@ def iprand(): In [7]: 3+4 Out[7]: 7 - In [8]: print 'hello' + In [8]: print('hello') world # random In [9]: iprand() @@ -152,13 +152,10 @@ def iprand_all(): In [7]: 1 Out[7]: 99 - In [8]: print 'hello' + In [8]: print('hello') world In [9]: iprand_all() Out[9]: 'junk' """ return 'iprand_all' - - - diff --git a/IPython/testing/plugin/simple.py b/IPython/testing/plugin/simple.py index e3482d6..3861977 100644 --- a/IPython/testing/plugin/simple.py +++ b/IPython/testing/plugin/simple.py @@ -16,10 +16,10 @@ def pyfunc(): 5 >>> for i in range(3): - ... print i, - ... print i+1, + ... print(i, end=' ') + ... print(i+1, end=' ') ... - 0 1 1 2 2 3 + 0 1 1 2 2 3 """ return 'pyfunc' diff --git a/IPython/testing/tools.py b/IPython/testing/tools.py index c2fe99b..d17ce42 100644 --- a/IPython/testing/tools.py +++ b/IPython/testing/tools.py @@ -337,8 +337,8 @@ class AssertPrints(object): Examples -------- >>> with AssertPrints("abc", suppress=False): - ... print "abcd" - ... print "def" + ... print("abcd") + ... print("def") ... abcd def