Results of 1 - 10 of about 132 for assert (0.013 sec.)
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 12362
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...ck is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. unittest.mock provides a core Mock class removing the need to create a host of stubs th...roughout your test suite. 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...st で利用するために設計されており、多くのモックフレームワークで使われる 'record -> replay' パターンの代わりに、 'action -> assertion' パターンに基づいています。 There is a backport of unittest.mock for earlier versions of Python, available as mock on P... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 12362
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...ck is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. unittest.mock provides a core Mock class removing the need to create a host of stubs th...roughout your test suite. 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...st で利用するために設計されており、多くのモックフレームワークで使われる 'record -> replay' パターンの代わりに、 'action -> assertion' パターンに基づいています。 There is a backport of unittest.mock for earlier versions of Python, available as mock on P... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 11890
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p
...5 , key = 'value' ) <MagicMock name='method()' id='...'> モック(上の例では real.method )が利用された場合、どう使われたかを assert できるようにする属性やメソッドがモックにあります。 注釈 この例のような場合、たいてい Mock と MagicMock は互換です。 MagicM...力なので、デフォルトではこちらを使うといいでしょう。 モックが呼び出されると、その called 属性が True に設定されます。そして assert_called_with() や assert_called_once_with() メソッドを使ってそのメソッドが正しい引数で呼び出されたかどうかをチェックできます...... pass ... >>> real = ProductionClass () >>> real . something = MagicMock () >>> real . method () >>> real . something . assert_called_once_with ( 1 , 2 , 3 ) Mock for method calls on an object ¶ 上の例ではオブジェクトのメソッドに対して直接パッチを当... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 11890
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock p
...5 , key = 'value' ) <MagicMock name='method()' id='...'> モック(上の例では real.method )が利用された場合、どう使われたかを assert できるようにする属性やメソッドがモックにあります。 注釈 この例のような場合、たいてい Mock と MagicMock は互換です。 MagicM...力なので、デフォルトではこちらを使うといいでしょう。 モックが呼び出されると、その called 属性が True に設定されます。そして assert_called_with() や assert_called_once_with() メソッドを使ってそのメソッドが正しい引数で呼び出されたかどうかをチェックできます...... pass ... >>> real = ProductionClass () >>> real . something = MagicMock () >>> real . method () >>> real . something . assert_called_once_with ( 1 , 2 , 3 ) Mock for method calls on an object ¶ 上の例ではオブジェクトのメソッドに対して直接パッチを当... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- 索引 — Python 3.14.8 ドキュメント 8306
- ナビゲーション 索引 モジュール | Python » 3.14.8 Documentation » 索引 テーマ 自動 ライト ダーク | Index – A A (re モジュール) a2b_base64() (binascii モジュール) a2b_hex() (binascii モジュール) a2b_qp() (binascii モジュール) a2b_uu() (binasc
...kyesno() (tkinter.messagebox モジュール) askyesnocancel() (tkinter.messagebox モジュール) aspect() (tkinter.Wm のメソッド) assert statement , [1] Assert (ast のクラス) assert_any_await() (unittest.mock.AsyncMock のメソッド) assert_any_call() (unittest....mock.Mock のメソッド) assert_awaited() (unittest.mock.AsyncMock のメソッド) assert_awaited_once() (unittest.mock.AsyncMock のメソッド) assert_awaited_o...nce_with() (unittest.mock.AsyncMock のメソッド) assert_awaited_with() (unittest.mock.AsyncMock のメソッド) assert_called() (unittest.mock.Mock のメソッド) assert_called_once() (... - https://man.mtool.work/python/3.14/genindex-A.html
- 索引 — Python 3.14.8 ドキュメント 8306
- ナビゲーション 索引 モジュール | Python » 3.14.8 Documentation » 索引 テーマ 自動 ライト ダーク | Index – A A (re モジュール) a2b_base64() (binascii モジュール) a2b_hex() (binascii モジュール) a2b_qp() (binascii モジュール) a2b_uu() (binasc
...kyesno() (tkinter.messagebox モジュール) askyesnocancel() (tkinter.messagebox モジュール) aspect() (tkinter.Wm のメソッド) assert statement , [1] Assert (ast のクラス) assert_any_await() (unittest.mock.AsyncMock のメソッド) assert_any_call() (unittest....mock.Mock のメソッド) assert_awaited() (unittest.mock.AsyncMock のメソッド) assert_awaited_once() (unittest.mock.AsyncMock のメソッド) assert_awaited_o...nce_with() (unittest.mock.AsyncMock のメソッド) assert_awaited_with() (unittest.mock.AsyncMock のメソッド) assert_called() (unittest.mock.Mock のメソッド) assert_called_once() (... - https://man.mtool.work/python/3.14/genindex-A.html
- typing --- 型ヒントのサポート — Python 3.14.8 ドキュメント 8209
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » typing --- 型ヒントのサポート テーマ 自動 ライト ダーク | typing --- 型ヒントのサポート ¶ Added in version 3.5. ソース
...se RuntimeError ( 'no way' ) Or to define a function that should never be called, as there are no valid arguments, such as assert_never() : from typing import Never # or NoReturn def never_call_me ( arg : Never ) -> None : pass def int_or_str ( arg : i...al details: The arguments must be literal values and there must be at least one. Nested Literal types are flattened, e.g.: assert Literal [ Literal [ 1 , 2 ], 3 ] == Literal [ 1 , 2 , 3 ] However, this does not apply to Literal types referenced through...a type alias, to avoid forcing evaluation of the underlying TypeAliasType : type A = Literal [ 1 , 2 ] assert Literal [ A , 3 ] != Literal [ 1 , 2 , 3 ] 冗長な実引数は飛ばされます。例えば: assert Literal [ 1 , 2 , 1 ] == Literal [ 1... - https://man.mtool.work/python/3.14/library/typing.html
- typing --- 型ヒントのサポート — Python 3.14.8 ドキュメント 8209
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » typing --- 型ヒントのサポート テーマ 自動 ライト ダーク | typing --- 型ヒントのサポート ¶ Added in version 3.5. ソース
...se RuntimeError ( 'no way' ) Or to define a function that should never be called, as there are no valid arguments, such as assert_never() : from typing import Never # or NoReturn def never_call_me ( arg : Never ) -> None : pass def int_or_str ( arg : i...al details: The arguments must be literal values and there must be at least one. Nested Literal types are flattened, e.g.: assert Literal [ Literal [ 1 , 2 ], 3 ] == Literal [ 1 , 2 , 3 ] However, this does not apply to Literal types referenced through...a type alias, to avoid forcing evaluation of the underlying TypeAliasType : type A = Literal [ 1 , 2 ] assert Literal [ A , 3 ] != Literal [ 1 , 2 , 3 ] 冗長な実引数は飛ばされます。例えば: assert Literal [ 1 , 2 , 1 ] == Literal [ 1... - https://man.mtool.work/python/3.14/library/typing.html
- types --- 動的な型生成と組み込み型の名前 — Python 3.14.8 ドキュメント 7313
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » types --- 動的な型生成と組み込み型の名前 テーマ 自動 ライト ダーク | types --- 動的な型生成と組み込み型の名前 ¶ ソースコ
...): ... Eggs = NamedTuple ( "Eggs" , [( "a" , int ), ( "b" , str )]) Spam = TypedDict ( "Spam" , { "a" : int , "b" : str }) assert Bar . __bases__ == ( Foo , float ) assert get_original_bases ( Bar ) == ( Foo [ int ], float ) assert Baz . __bases__ == (...list ,) assert get_original_bases ( Baz ) == ( list [ str ],) assert Eggs . __bases__ == ( tuple ,) assert get_original_bases ( Eggs ) ==...( NamedTuple ,) assert Spam . __bases__ == ( dict ,) assert get_original_bases ( Spam ) == ( TypedDict ,) assert int . __bases__ == ( object ,) a... - https://man.mtool.work/python/3.14/library/types.html
- types --- 動的な型生成と組み込み型の名前 — Python 3.14.8 ドキュメント 7313
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » データ型 » types --- 動的な型生成と組み込み型の名前 テーマ 自動 ライト ダーク | types --- 動的な型生成と組み込み型の名前 ¶ ソースコ
...): ... Eggs = NamedTuple ( "Eggs" , [( "a" , int ), ( "b" , str )]) Spam = TypedDict ( "Spam" , { "a" : int , "b" : str }) assert Bar . __bases__ == ( Foo , float ) assert get_original_bases ( Bar ) == ( Foo [ int ], float ) assert Baz . __bases__ == (...list ,) assert get_original_bases ( Baz ) == ( list [ str ],) assert Eggs . __bases__ == ( tuple ,) assert get_original_bases ( Eggs ) ==...( NamedTuple ,) assert Spam . __bases__ == ( dict ,) assert get_original_bases ( Spam ) == ( TypedDict ,) assert int . __bases__ == ( object ,) a... - https://man.mtool.work/python/3.14/library/types.html