Home
last modified time | relevance | path

Searched refs:new_callable (Results 1 – 9 of 9) sorted by relevance

/third_party/python/Lib/unittest/test/testmock/
Dtestpatch.py1060 patcher = patch(foo_name, new_callable=NonCallableMagicMock)
1073 patcher = patch.object(Foo, 'f', new_callable=NonCallableMagicMock)
1091 patcher = patch(foo_name, new_callable=Bar, arg1=1, arg2=2)
1106 patcher = patch(foo_name, new_callable=Bar, spec=Bar)
1113 patcher = patch(foo_name, new_callable=Bar, spec_set=Bar)
1123 p = patch(non_existent_attr, new_callable=NonCallableMock)
1126 p = patch(non_existent_attr, new_callable=NonCallableMock,
1137 ValueError, patch, foo_name, new=object(), new_callable=MagicMock
1141 new_callable=MagicMock
1147 ValueError, patch, foo_name, new_callable=MagicMock,
[all …]
Dtesthelpers.py1063 p = patch('%s.SomeClass.one' % __name__, new_callable=PropertyMock)
/third_party/python/Lib/unittest/
Dmock.py1273 spec_set, autospec, new_callable, kwargs, *, unsafe=False argument
1275 if new_callable is not None:
1298 self.new_callable = new_callable
1312 self.autospec, self.new_callable, self.kwargs
1420 new_callable = self.new_callable
1465 if new_callable is not None:
1466 Klass = new_callable
1615 new_callable=None, *, unsafe=False, **kwargs argument
1637 spec_set, autospec, new_callable, kwargs, unsafe=unsafe
1642 autospec=None, new_callable=None, **kwargs): argument
[all …]
/third_party/python/Lib/idlelib/idle_test/
Dtest_run.py60 new_callable=lambda: (lambda t, e: None))
374 new_callable=Func) as func:
Dtest_configdialog.py97 new_callable=Func) as view:
/third_party/python/Doc/library/
Dunittest.mock.rst225 the *new_callable* argument to :func:`patch`.
837 >>> with patch('__main__.Foo.foo', new_callable=PropertyMock) as mock_foo:
1336 …t, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)
1363 *new_callable* allows you to specify a different class, or callable object,
1408 :class:`MagicMock` otherwise or to *new_callable* if specified.
1455 The *new_callable* argument is useful where you want to use an alternative
1460 >>> with patch('__main__.thing', new_callable=NonCallableMock) as mock_thing:
1474 >>> @patch('sys.stdout', new_callable=StringIO)
1538 …e, new=DEFAULT, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs)
1545 *new_callable* have the same meaning as for :func:`patch`. Like :func:`patch`,
[all …]
/third_party/python/Lib/test/
Dtest_zipapp.py381 @patch('sys.stdout', new_callable=io.StringIO)
/third_party/python/Lib/test/test_asyncio/
Dtest_unix_events.py1186 new_callable=mock.Mock)
Dtest_base_events.py51 new_callable=mock_socket_module)(f)