summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test/testmock/testhelpers.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-04-21 22:53:14 (GMT)
committerBrett Cannon <brett@python.org>2012-04-21 22:53:14 (GMT)
commitb582c923ba4b0833e840360994743b68e0dfe219 (patch)
tree459095eb90f234794d70379d5a0c3653e1acdbb4 /Lib/unittest/test/testmock/testhelpers.py
parenta64faf0771bceee789dd345202919147f595bfd3 (diff)
parent9cf5c9d85e3b904a76acac3cbcdc0d45c4e486b5 (diff)
downloadcpython-b582c923ba4b0833e840360994743b68e0dfe219.zip
cpython-b582c923ba4b0833e840360994743b68e0dfe219.tar.gz
cpython-b582c923ba4b0833e840360994743b68e0dfe219.tar.bz2
merge
Diffstat (limited to 'Lib/unittest/test/testmock/testhelpers.py')
-rw-r--r--Lib/unittest/test/testmock/testhelpers.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/Lib/unittest/test/testmock/testhelpers.py b/Lib/unittest/test/testmock/testhelpers.py
index 4c43f87..7a7145e 100644
--- a/Lib/unittest/test/testmock/testhelpers.py
+++ b/Lib/unittest/test/testmock/testhelpers.py
@@ -367,7 +367,7 @@ class SpecSignatureTest(unittest.TestCase):
def test_create_autospec_unbound_methods(self):
- # see issue 128
+ # see mock issue 128
# this is expected to fail until the issue is fixed
return
class Foo(object):
@@ -391,6 +391,19 @@ class SpecSignatureTest(unittest.TestCase):
self.assertEqual(m.a, '3')
+ def test_create_autospec_keyword_only_arguments(self):
+ def foo(a, *, b=None):
+ pass
+
+ m = create_autospec(foo)
+ m(1)
+ m.assert_called_with(1)
+ self.assertRaises(TypeError, m, 1, 2)
+
+ m(2, b=3)
+ m.assert_called_with(2, b=3)
+
+
def test_function_as_instance_attribute(self):
obj = SomeClass()
def f(a):