Results of 1 - 10 of about 65 for patch (0.055 sec.)
- 変更履歴 — Python 3.14.8 ドキュメント 14042
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » 変更履歴 テーマ 自動 ライト ダーク | 変更履歴 ¶ Python next ¶ Release date: XXXX-XX-XX セキュリティ ¶ gh-157265 : In tarfile , when extrac
...with the link's. Core and Builtins ¶ gh-158583 : bytes.fromhex() and bytearray.fromhex() : Fix uninitialized memory read. Patch by Victor Stinner. gh-156204 : Fix a crash in PyErr_GivenExceptionMatches() when evaluating deeply nested exception tuples...d, avoiding potential hangs and stack overflows. Fix asyncio task inspection when awaited-by sets contain removed entries. Patch by Maurycy Pawłowski-Wieroński. Python 3.14.8 final ¶ Release date: 2026-09-30 セキュリティ ¶ gh-158446 : Fix a crash or i...et for the "Non-UTF-8 code starting with ..." error when a non-ASCII character precedes the invalid byte on the same line. Patch by Shamil Abdulaev. gh-156762 : Fix undefined behaviour in operator.methodcaller : its tp_clear slot function returned voi... - https://man.mtool.work/python/3.14/whatsnew/changelog.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 11150
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...es and set needed attributes in the normal way. 加えて、 mock はテストのスコープ内にあるモジュールやクラスの属性を変更する patch() デコレータを提供します。さらに、ユニークなオブジェクトの作成には sentinel が利用できます。 Mock や MagicMock 、 patch()...らの仕様を受け取るよう設定できます。 spec にないモックの属性やメソッドにアクセスを試みた場合、 AttributeError で失敗します。 patch() デコレータ / コンテキストマネージャーによってテスト対象のモジュール内のクラスやオブジェクトを簡単にモックできます。指定し...ブジェクトはテスト中はモック (または別のオブジェクト) に置換され、テスト終了時に復元されます: >>> from unittest.mock import patch >>> @patch ( 'module.ClassName2' ) ... @patch ( 'module.ClassName1' ) ... def test ( MockClass1 , MockClass2 ): ... module... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- モックオブジェクトライブラリ — Python 3.14.8 ドキュメント 11150
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- モックオブジェクトライブラリ テーマ 自動 ライト ダーク | unittest.mock --- モックオブジェクトライブラ
...es and set needed attributes in the normal way. 加えて、 mock はテストのスコープ内にあるモジュールやクラスの属性を変更する patch() デコレータを提供します。さらに、ユニークなオブジェクトの作成には sentinel が利用できます。 Mock や MagicMock 、 patch()...らの仕様を受け取るよう設定できます。 spec にないモックの属性やメソッドにアクセスを試みた場合、 AttributeError で失敗します。 patch() デコレータ / コンテキストマネージャーによってテスト対象のモジュール内のクラスやオブジェクトを簡単にモックできます。指定し...ブジェクトはテスト中はモック (または別のオブジェクト) に置換され、テスト終了時に復元されます: >>> from unittest.mock import patch >>> @patch ( 'module.ClassName2' ) ... @patch ( 'module.ClassName1' ) ... def test ( MockClass1 , MockClass2 ): ... module... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- 変更履歴 — Python 3.14.8 ドキュメント 10764
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » 変更履歴 テーマ 自動 ライト ダーク | 変更履歴 ¶ Python next ¶ Release date: XXXX-XX-XX セキュリティ ¶ gh-157265 : In tarfile , when extrac
...with the link's. Core and Builtins ¶ gh-158583 : bytes.fromhex() and bytearray.fromhex() : Fix uninitialized memory read. Patch by Victor Stinner. gh-156204 : Fix a crash in PyErr_GivenExceptionMatches() when evaluating deeply nested exception tuples...d, avoiding potential hangs and stack overflows. Fix asyncio task inspection when awaited-by sets contain removed entries. Patch by Maurycy Pawłowski-Wieroński. Python 3.14.8 final ¶ Release date: 2026-09-30 セキュリティ ¶ gh-158446 : Fix a crash or i...et for the "Non-UTF-8 code starting with ..." error when a non-ASCII character precedes the invalid byte on the same line. Patch by Shamil Abdulaev. gh-156762 : Fix undefined behaviour in operator.methodcaller : its tp_clear slot function returned voi... - https://man.mtool.work/python/3.14/whatsnew/changelog.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 10678
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock patch
...他のよくあるユースケースが、テスト対象のコードによってインスタンス化されているクラスをモックに置き換えることです。クラスに patch すると、そのクラスがモックに置き換えられます。インスタンスは クラスを呼び出した時に 作られます。なので、モックの戻り値を使...ンス」にアクセスできます。 次の例では、 some_function という関数が Foo をインスタンス化し、その method を呼び出しています。 patch() を呼び出すと Foo クラスをモックに置き換えます。 Foo のインスタンスはモックを呼び出して作られるので、モックの return_valu...スタマイズできます。: >>> def some_function (): ... instance = module . Foo () ... return instance . method () ... >>> with patch ( 'module.Foo' ) as mock : ... instance = mock . return_value ... instance . method . return_value = 'the result' ... resu... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- unittest.mock --- 入門 — Python 3.14.8 ドキュメント 10678
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール » unittest.mock --- 入門 テーマ 自動 ライト ダーク | unittest.mock --- 入門 ¶ Added in version 3.3. Mock を使う ¶ Mock patch
...他のよくあるユースケースが、テスト対象のコードによってインスタンス化されているクラスをモックに置き換えることです。クラスに patch すると、そのクラスがモックに置き換えられます。インスタンスは クラスを呼び出した時に 作られます。なので、モックの戻り値を使...ンス」にアクセスできます。 次の例では、 some_function という関数が Foo をインスタンス化し、その method を呼び出しています。 patch() を呼び出すと Foo クラスをモックに置き換えます。 Foo のインスタンスはモックを呼び出して作られるので、モックの return_valu...スタマイズできます。: >>> def some_function (): ... instance = module . Foo () ... return instance . method () ... >>> with patch ( 'module.Foo' ) as mock : ... instance = mock . return_value ... instance . method . return_value = 'the result' ... resu... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- 開発ツール — Python 3.14.8 ドキュメント 8044
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール テーマ 自動 ライト ダーク | 開発ツール ¶ この章で紹介されるモジュールはソフトウェアを書くことを支援します。たとえば、 py
...ックオブジェクトライブラリ クイックガイド Mock クラス 呼び出し 属性の削除 Mock の名前と name 属性 属性として設定されるモック patcher patch patch.object patch.dict patch.multiple patch のメソッド: start と stop ビルトインをパッチする TEST_PREFIX patch デ...c を使う Sealing mocks Order of precedence of side_effect , return_value and wraps unittest.mock --- 入門 Mock を使う Mock patching methods Mock for method calls on an object Mocking classes モックに名前をつける Tracking all calls Setting return value...同期コンテキストマネージャをモックする Creating a mock from an existing object Using side_effect to return per file content Patch decorators Further examples chained call をモックする 部分的なモック Mocking a generator method 同じパッチを全てのメソッド... - https://man.mtool.work/python/3.14/library/development.html
- 開発ツール — Python 3.14.8 ドキュメント 8044
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » The Python standard library » 開発ツール テーマ 自動 ライト ダーク | 開発ツール ¶ この章で紹介されるモジュールはソフトウェアを書くことを支援します。たとえば、 py
...ックオブジェクトライブラリ クイックガイド Mock クラス 呼び出し 属性の削除 Mock の名前と name 属性 属性として設定されるモック patcher patch patch.object patch.dict patch.multiple patch のメソッド: start と stop ビルトインをパッチする TEST_PREFIX patch デ...c を使う Sealing mocks Order of precedence of side_effect , return_value and wraps unittest.mock --- 入門 Mock を使う Mock patching methods Mock for method calls on an object Mocking classes モックに名前をつける Tracking all calls Setting return value...同期コンテキストマネージャをモックする Creating a mock from an existing object Using side_effect to return per file content Patch decorators Further examples chained call をモックする 部分的なモック Mocking a generator method 同じパッチを全てのメソッド... - https://man.mtool.work/python/3.14/library/development.html
- What's New in Python 2.7 — Python 3.14.8 ドキュメント 7157
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » What's New in Python 2.7 テーマ 自動 ライト ダーク | What's New in Python 2.7 ¶ 著者 : A.M. Kuchling (amk at amk.ca) この文書は Python 2.7
...か、 https://bugs.python.org に議論したい機能について登録してください。可能な限り、 "What's New in Python" は各変更の bug や patch に対してリンクしています。 Python 2.x の今後 ¶ Python 2.7 は 2.x シリーズの最後のメジャーリリースになります。Python のメン...算は 50% から 150% 高速化されています。 (Contributed by Mark Dickinson; bpo-5512 .) ビット演算も高速化されています。(initial patch by Gregory Smith; bpo-1087418 ) % の実装が、左側のオペランドが文字列型かどうかをチェックしてその場合の処理を特殊化しました...nted by Collin Winter; bpo-5176 .) if 条件付きのリスト内包表記がより高速なバイトコードにコンパイルされるようになりました。(Patch by Antoine Pitrou, back-ported to 2.7 by Jeffrey Yasskin; bpo-4715 .) 整数や多倍長整数から10進文字列への変換を、任意の基数... - https://man.mtool.work/python/3.14/whatsnew/2.7.html
- What's New in Python 2.7 — Python 3.14.8 ドキュメント 7128
- ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.14.8 Documentation » What's New in Python » What's New in Python 2.7 テーマ 自動 ライト ダーク | What's New in Python 2.7 ¶ 著者 : A.M. Kuchling (amk at amk.ca) この文書は Python 2.7
...か、 https://bugs.python.org に議論したい機能について登録してください。可能な限り、 "What's New in Python" は各変更の bug や patch に対してリンクしています。 Python 2.x の今後 ¶ Python 2.7 は 2.x シリーズの最後のメジャーリリースになります。Python のメン...算は 50% から 150% 高速化されています。 (Contributed by Mark Dickinson; bpo-5512 .) ビット演算も高速化されています。(initial patch by Gregory Smith; bpo-1087418 ) % の実装が、左側のオペランドが文字列型かどうかをチェックしてその場合の処理を特殊化しました...nted by Collin Winter; bpo-5176 .) if 条件付きのリスト内包表記がより高速なバイトコードにコンパイルされるようになりました。(Patch by Antoine Pitrou, back-ported to 2.7 by Jeffrey Yasskin; bpo-4715 .) 整数や多倍長整数から10進文字列への変換を、任意の基数... - https://man.mtool.work/python/3.14/whatsnew/2.7.html