summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-04-02 01:32:06 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-04-02 01:32:06 (GMT)
commitb31daff1f77c071b36b43bf874befd7c66e55342 (patch)
tree1dee3e9b2745ed7f27d29edd9353a4d4b47e0466
parent16c7cfda7c6196b882c9b25f2e12e1bf75b605e9 (diff)
downloadcpython-b31daff1f77c071b36b43bf874befd7c66e55342.zip
cpython-b31daff1f77c071b36b43bf874befd7c66e55342.tar.gz
cpython-b31daff1f77c071b36b43bf874befd7c66e55342.tar.bz2
Issue #26688: Fix module name in mock docs
Patch by Ashley Anderson.
-rw-r--r--Doc/library/unittest.mock-examples.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst
index ac7fce0..0bb52ef 100644
--- a/Doc/library/unittest.mock-examples.rst
+++ b/Doc/library/unittest.mock-examples.rst
@@ -359,7 +359,7 @@ The module name can be 'dotted', in the form ``package.module`` if needed:
A nice pattern is to actually decorate test methods themselves:
- >>> class MyTest(unittest2.TestCase):
+ >>> class MyTest(unittest.TestCase):
... @patch.object(SomeClass, 'attribute', sentinel.attribute)
... def test_something(self):
... self.assertEqual(SomeClass.attribute, sentinel.attribute)
@@ -372,7 +372,7 @@ If you want to patch with a Mock, you can use :func:`patch` with only one argume
(or :func:`patch.object` with two arguments). The mock will be created for you and
passed into the test function / method:
- >>> class MyTest(unittest2.TestCase):
+ >>> class MyTest(unittest.TestCase):
... @patch.object(SomeClass, 'static_method')
... def test_something(self, mock_method):
... SomeClass.static_method()
@@ -382,7 +382,7 @@ passed into the test function / method:
You can stack up multiple patch decorators using this pattern:
- >>> class MyTest(unittest2.TestCase):
+ >>> class MyTest(unittest.TestCase):
... @patch('package.module.ClassName1')
... @patch('package.module.ClassName2')
... def test_something(self, MockClass2, MockClass1):