Skip to content

Commit

Permalink
Py3fy some doctests. (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer authored and larsoner committed May 31, 2019
1 parent bd02bf7 commit 2578a92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions doc/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ def foo(var1, var2, long_var_name='hi'):
use the function.
>>> a = [1, 2, 3]
>>> print [x + 3 for x in a]
>>> print([x + 3 for x in a])
[4, 5, 6]
>>> print "a\n\nb"
>>> print("a\n\nb")
a
b
Expand Down
12 changes: 6 additions & 6 deletions numpydoc/tests/test_docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@
>>> mean = (1,2)
>>> cov = [[1,0],[1,0]]
>>> x = multivariate_normal(mean,cov,(3,3))
>>> print x.shape
>>> print(x.shape)
(3, 3, 2)
The following is probably true, given that 0.6 is roughly twice the
standard deviation:
>>> print list( (x[0,0,:] - mean) < 0.6 )
>>> print(list((x[0, 0, :] - mean) < 0.6))
[True, True]
.. index:: random
Expand Down Expand Up @@ -495,13 +495,13 @@ def test_str():
>>> mean = (1,2)
>>> cov = [[1,0],[1,0]]
>>> x = multivariate_normal(mean,cov,(3,3))
>>> print x.shape
>>> print(x.shape)
(3, 3, 2)
The following is probably true, given that 0.6 is roughly twice the
standard deviation:
>>> print list( (x[0,0,:] - mean) < 0.6 )
>>> print(list((x[0, 0, :] - mean) < 0.6))
[True, True]
.. index:: random
Expand Down Expand Up @@ -666,13 +666,13 @@ def test_sphinx_str():
>>> mean = (1,2)
>>> cov = [[1,0],[1,0]]
>>> x = multivariate_normal(mean,cov,(3,3))
>>> print x.shape
>>> print(x.shape)
(3, 3, 2)
The following is probably true, given that 0.6 is roughly twice the
standard deviation:
>>> print list( (x[0,0,:] - mean) < 0.6 )
>>> print(list((x[0, 0, :] - mean) < 0.6))
[True, True]
""")

Expand Down

0 comments on commit 2578a92

Please sign in to comment.