summaryrefslogtreecommitdiffstats
path: root/Doc/library/unittest.mock.rst
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-09-10 18:41:15 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-09-10 18:41:15 (GMT)
commit920f6db10b8ebe59190f33d588fcdaa7b2b452a2 (patch)
treeb8633ee53a440af5895085fb60359dd75903a79f /Doc/library/unittest.mock.rst
parent3fc536f1c95abdd57bc4172fb8eb96fd86cab4d3 (diff)
downloadcpython-920f6db10b8ebe59190f33d588fcdaa7b2b452a2.zip
cpython-920f6db10b8ebe59190f33d588fcdaa7b2b452a2.tar.gz
cpython-920f6db10b8ebe59190f33d588fcdaa7b2b452a2.tar.bz2
Use print function in mock docs.
Diffstat (limited to 'Doc/library/unittest.mock.rst')
-rw-r--r--Doc/library/unittest.mock.rst12
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
index 13b3133..48eefe9 100644
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -532,7 +532,7 @@ the *new_callable* argument to :func:`patch`.
keyword arguments (or an empty dictionary).
>>> mock = Mock(return_value=None)
- >>> print mock.call_args
+ >>> print(mock.call_args)
None
>>> mock()
>>> mock.call_args
@@ -727,7 +727,7 @@ apply to method calls on the mock object.
>>> with patch('__main__.Foo.foo', new_callable=PropertyMock) as mock_foo:
... mock_foo.return_value = 'mockity-mock'
... this_foo = Foo()
- ... print this_foo.foo
+ ... print(this_foo.foo)
... this_foo.foo = 6
...
mockity-mock
@@ -1109,7 +1109,7 @@ Another use case might be to replace an object with a :class:`io.StringIO` insta
>>> from io import StringIO
>>> def foo():
- ... print 'Something'
+ ... print('Something')
...
>>> @patch('sys.stdout', new_callable=StringIO)
... def test(mock_stdout):
@@ -1223,7 +1223,7 @@ ends.
>>> import os
>>> with patch.dict('os.environ', {'newkey': 'newvalue'}):
- ... print os.environ['newkey']
+ ... print(os.environ['newkey'])
...
newvalue
>>> assert 'newkey' not in os.environ
@@ -1420,9 +1420,9 @@ inform the patchers of the different prefix by setting ``patch.TEST_PREFIX``:
>>> @patch('__main__.value', 'not three')
... class Thing:
... def foo_one(self):
- ... print value
+ ... print(value)
... def foo_two(self):
- ... print value
+ ... print(value)
...
>>>
>>> Thing().foo_one()