Results of 1 - 2 of about 2 for MockClass (0.007 sec.)
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 11228
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...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 throughout your test suite. After performing an action, you can make assertio...: >>> from unittest.mock import patch >>> @patch ( 'module.ClassName2' ) ... @patch ( 'module.ClassName1' ) ... def test ( MockClass1 , MockClass2 ): ... module . ClassName1 () ... module . ClassName2 () ... assert MockClass1 is module . ClassName1 ... as...sert MockClass2 is module . ClassName2 ... assert MockClass1 . called ... assert MockClass2 . called ... >>> test () 注釈 patch デコレータ... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 7485
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...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 throughout your test suite. After performing an action, you can make assertio...: >>> from unittest.mock import patch >>> @patch ( 'module.ClassName2' ) ... @patch ( 'module.ClassName1' ) ... def test ( MockClass1 , MockClass2 ): ... module . ClassName1 () ... module . ClassName2 () ... assert MockClass1 is module . ClassName1 ... as...sert MockClass2 is module . ClassName2 ... assert MockClass1 . called ... assert MockClass2 . called ... >>> test () 注釈 patch デコレータ... - https://man.mtool.work/python/3.14/library/unittest.mock.html
PREV
1
NEXT