[Python-checkins] cpython (merge 3.5 -> default): Use print function in mock docs.
berker.peksag
python-checkins at python.org
Thu Sep 10 20:42:44 CEST 2015
https://hg.python.org/cpython/rev/f41cdb99202f
changeset: 97860:f41cdb99202f
parent: 97857:7fc4306d537b
parent: 97859:a380841644b2
user: Berker Peksag <berker.peksag at gmail.com>
date: Thu Sep 10 21:42:18 2015 +0300
summary:
Use print function in mock docs.
files:
Doc/library/unittest.mock.rst | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -552,7 +552,7 @@
keyword arguments (or an empty dictionary).
>>> mock = Mock(return_value=None)
- >>> print mock.call_args
+ >>> print(mock.call_args)
None
>>> mock()
>>> mock.call_args
@@ -747,7 +747,7 @@
>>> 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
@@ -1135,7 +1135,7 @@
>>> from io import StringIO
>>> def foo():
- ... print 'Something'
+ ... print('Something')
...
>>> @patch('sys.stdout', new_callable=StringIO)
... def test(mock_stdout):
@@ -1249,7 +1249,7 @@
>>> import os
>>> with patch.dict('os.environ', {'newkey': 'newvalue'}):
- ... print os.environ['newkey']
+ ... print(os.environ['newkey'])
...
newvalue
>>> assert 'newkey' not in os.environ
@@ -1462,9 +1462,9 @@
>>> @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()
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list