Results of 1 - 10 of about 552 for Call (0.040 sec.)
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 8417
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...te. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way. 加えて、 mock はテストのスコープ内...g . method = MagicMock ( return_value = 3 ) >>> thing . method ( 3 , 4 , 5 , key = 'value' ) 3 >>> thing . method . assert_called_with ( 3 , 4 , 5 , key = 'value' ) side_effect によって、モック呼び出し時の例外発生などの副作用を実行できます: >>> from...unittest.mock import Mock >>> mock = Mock ( side_effect = KeyError ( 'foo' )) >>> mock () Traceback (most recent call last): ... KeyError : 'foo' >>> values = { 'a' : 1 , 'b' : 2 , 'c' : 3 } >>> def side_effect ( arg ): ... return values [... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 8417
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...te. After performing an action, you can make assertions about which methods / attributes were used and arguments they were called with. You can also specify return values and set needed attributes in the normal way. 加えて、 mock はテストのスコープ内...g . method = MagicMock ( return_value = 3 ) >>> thing . method ( 3 , 4 , 5 , key = 'value' ) 3 >>> thing . method . assert_called_with ( 3 , 4 , 5 , key = 'value' ) side_effect によって、モック呼び出し時の例外発生などの副作用を実行できます: >>> from...unittest.mock import Mock >>> mock = Mock ( side_effect = KeyError ( 'foo' )) >>> mock () Traceback (most recent call last): ... KeyError : 'foo' >>> values = { 'a' : 1 , 'b' : 2 , 'c' : 3 } >>> def side_effect ( arg ): ... return values [... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 8064
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p
...MagicMock は互換です。 MagicMock の方が強力なので、デフォルトではこちらを使うといいでしょう。 モックが呼び出されると、その called 属性が True に設定されます。そして assert_called_with() や assert_called_once_with() メソッドを使ってそのメソッドが正しい...s ... >>> real = ProductionClass () >>> real . something = MagicMock () >>> real . method () >>> real . something . assert_called_once_with ( 1 , 2 , 3 ) Mock for method calls on an object ¶ 上の例ではオブジェクトのメソッドに対して直接パッチを当てて、...しなければなりません。 >>> real = ProductionClass () >>> mock = Mock () >>> real . closer ( mock ) >>> mock . close . assert_called_with () モックに close メソッドを持たせるために何か準備する必要はありません。 close メソッドにアクセスすると自動的にそれ... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 8064
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p
...MagicMock は互換です。 MagicMock の方が強力なので、デフォルトではこちらを使うといいでしょう。 モックが呼び出されると、その called 属性が True に設定されます。そして assert_called_with() や assert_called_once_with() メソッドを使ってそのメソッドが正しい...s ... >>> real = ProductionClass () >>> real . something = MagicMock () >>> real . method () >>> real . something . assert_called_once_with ( 1 , 2 , 3 ) Mock for method calls on an object ¶ 上の例ではオブジェクトのメソッドに対して直接パッチを当てて、...しなければなりません。 >>> real = ProductionClass () >>> mock = Mock () >>> real . closer ( mock ) >>> mock . close . assert_called_with () モックに close メソッドを持たせるために何か準備する必要はありません。 close メソッドにアクセスすると自動的にそれ... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- Call プロトコル — Python 3.14.8 ドキュメント 7812
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 抽象オブジェクトレイヤ (Abstract Objects Layer) » Call プロトコル テーマ 自動 ライト ダーク | Call プロトコル ¶ CPython supports
...two different calling protocols: tp_call and vectorcall. The tp_call Protocol ¶ Instances of classes that set tp_call are callable. The signa...ture of the slot is: PyObject * tp_call ( PyObject * callable , PyObject * args , PyObject * kwargs ); A call is made using a tuple for the positional arguments a...nd a dict for the keyword arguments, similarly to callable(*args, **kwargs) in Python code. args must be non-NULL (use an empty tuple if there are no arguments) but kwargs may b... - https://man.mtool.work/python/3.14/c-api/call.html
- Call プロトコル — Python 3.14.8 ドキュメント 7812
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » Python/C API reference manual » 抽象オブジェクトレイヤ (Abstract Objects Layer) » Call プロトコル テーマ 自動 ライト ダーク | Call プロトコル ¶ CPython supports
...two different calling protocols: tp_call and vectorcall. The tp_call Protocol ¶ Instances of classes that set tp_call are callable. The signa...ture of the slot is: PyObject * tp_call ( PyObject * callable , PyObject * args , PyObject * kwargs ); A call is made using a tuple for the positional arguments a...nd a dict for the keyword arguments, similarly to callable(*args, **kwargs) in Python code. args must be non-NULL (use an empty tuple if there are no arguments) but kwargs may b... - https://man.mtool.work/python/3.14/c-api/call.html
- Call graph introspection — Python 3.14.8 ドキュメント 7720
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » Call graph introspection テーマ 自動 ライト ダーク | Call graph introsp
...ection ¶ Source code: Lib/asyncio/graph.py asyncio has powerful runtime call graph introspection utilities to trace the entire call graph of a running coroutine or task , or a suspended future . Thes...ion tools Command-line tools for inspecting tasks in another running Python process. Added in version 3.14. asyncio. print_call_graph ( future = None , / , * , file = None , depth = 1 , limit = None ) ¶ Print the async call graph for the current task...he function receives an optional future argument. If not passed, the current running task will be used. If the function is called on the current task , the optional keyword-only depth argument can be used to skip the specified number of frames from t... - https://man.mtool.work/python/3.14/library/asyncio-graph.html
- Call graph introspection — Python 3.14.8 ドキュメント 7651
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » ネットワーク通信とプロセス間通信 » asyncio --- 非同期 I/O » Call graph introspection テーマ 自動 ライト ダーク | Call graph introsp
...ection ¶ Source code: Lib/asyncio/graph.py asyncio has powerful runtime call graph introspection utilities to trace the entire call graph of a running coroutine or task , or a suspended future . Thes...ion tools Command-line tools for inspecting tasks in another running Python process. Added in version 3.14. asyncio. print_call_graph ( future = None , / , * , file = None , depth = 1 , limit = None ) ¶ Print the async call graph for the current task...he function receives an optional future argument. If not passed, the current running task will be used. If the function is called on the current task , the optional keyword-only depth argument can be used to skip the specified number of frames from t... - https://man.mtool.work/python/3.14/library/asyncio-graph.html
- 変更履歴 — Python 3.14.8 ドキュメント 7589
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » 変更履歴 テーマ 自動 ライト ダーク | 変更履歴 ¶ Python next ¶ Release date: XXXX-XX-XX セキュリティ ¶ gh-157265 : In tarfile , when extrac
...ting a link falls back to extracting a member of the archive, skip the member when the filter function returns None when called with the extracted member's name replaced with the link's. Core and Builtins ¶ gh-158583 : bytes.fromhex() and bytearray...esolved path, but intermediate directories were created from the name as given. gh-156293 : Fix a crash in ssl when an sni_callback switches a connection to another SSLContext and the context that carries the callback is no longer referenced by the a...pplication. Servers that keep their sni_callback context alive (the usual case when it wraps the listening socket or is stored on the server object) were not affected.... - https://man.mtool.work/python/3.14/whatsnew/changelog.html
- annotationlib --- Functionality for introspecting annotations — Python 3.14.8 ... 6471
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » Python ランタイムサービス » annotationlib --- Functionality for introspecting annotations テーマ 自動 ライト ダーク | annotationlib
...directly with the annotate function that is used to evaluate annotations, such as get_annotate_from_class_namespace() and call_annotate_function() , as well as the call_evaluate_function() function for working with evaluate functions . 注意 Most fun...rwardRef instances returned by get_annotations() retain references to information about the scope they originated from, so calling this method with no further arguments may be sufficient to evaluate such objects. ForwardRef instances created by other...get_annotations ( Movie , format = Format . STRING ) {'name': 'str', 'year': 'int'} Added in version 3.14. annotationlib. call_annotate_function ( annotate , format , * , owner = None ) ¶ Call the annotate function annotate with the given format , a... - https://man.mtool.work/python/3.14/library/annotationlib.html