Lines Matching defs:function
64 def function(a, b=Foo): pass
225 "Mock not passed into test function")
235 "Patched function didn't receive initial argument")
237 "Patched function didn't receive second argument")
239 "Mock not passed into test function")
241 "Second Mock not passed into test function")
669 # the new dictionary during function call
933 def function(mock):
940 test = patch(foo_name, autospec=True)(function)
948 test = patch.object(module, 'Foo', autospec=True)(function)
957 @patch('%s.function' % __name__, autospec=True)
959 function.assert_not_called()
960 self.assertRaises(AssertionError, function.assert_called)
961 self.assertRaises(AssertionError, function.assert_called_once)
962 function(1)
963 self.assertRaises(AssertionError, function.assert_not_called)
964 function.assert_called_with(1)
965 function.assert_called()
966 function.assert_called_once()
967 function(2, 3)
968 function.assert_called_with(2, 3)
970 self.assertRaises(TypeError, function)
971 self.assertRaises(AttributeError, getattr, function, 'foo')
977 @patch('%s.function' % __name__, autospec=True,
980 #self.assertEqual(function.abc, 'foo')
981 return function(1, 2)
1030 patcher = patch('%s.function' % __name__, new=3, autospec=True)
1034 patcher = patch.object(module, 'function', new=3, autospec=True)