per page, with , order by , clip by
Results of 1 - 10 of about 15 for Mock (0.010 sec.)
unittest.mock --- モックオブジェクトライブラリ 13323
unittest.mock --- モックオブジェクトライブラリ Added in version 3.3. ソースコード: Lib/unittest/mock.py unittest.mock は Python でテストを行うためのライブラリです。 テスト対象のシステムの一部をモックオブジェクトに置き換え、どのように使われた ... かをアサートできます。 unittest.mock は中核となる Mock クラスを提供し、テストスイート全体で数多くのスタブを作成する手間を省きます。 操作を実行した後、どのメソッ ... 引数で呼び出されたかをアサートできます。 戻り値を指定したり、必要な属性を通常の方法で設定したりすることもできます。 加えて、 mock はテストのスコープ内にあるモジュールやクラスの属性を変更する patch() デコレータを提供します。さらに、ユニークなオブジェクト ... の作成には sentinel が利用できます。 Mock や MagicMock 、 patch() の利用例は quick guide を参照してください。 Mock は unittest で利用するために設計されており、多くの ...
https://man.mtool.work/python/3.14/library/unittest.mock.html
unittest.mock --- 入門 12783
unittest.mock --- 入門 Added in version 3.3. Mock を使う モックでメソッドにパッチを当てる 一般的な Mock の使い方の中には次のものがあります: メソッドにパッチを当てる オブジェクトに対するメソッド呼び出しを記録する システムの他の部分からメソッ ... うかを確認するために、そのオブジェクトのメソッドを置き換えることができます: >>> real = SomeClass () >>> real . method = MagicMock ( name = 'method' ) >>> real . method ( 3 , 4 , 5 , key = 'value' ) <MagicMock name='method()' id='...'> モック(上の例では ... 利用された場合、どう使われたかを assert できるようにする属性やメソッドがモックにあります。 注釈 この例のような場合、たいてい Mock と MagicMock は互換です。 MagicMock の方が強力なので、デフォルトではこちらを使うといいでしょう。 モックが呼び出されると、そ ... 1 , 2 , 3 ) ... def something ( self , a , b , c ): ... pass ... >>> real = ProductionClass () >>> real . something = MagicMock () >>> real . method () >>> real . something . assert_called_once_with ( 1 , 2 , 3 ) オブジェクトのメソッド呼び出しにモック ...
https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
開発ツール 9195
開発ツール この章で紹介されるモジュールはソフトウェアを書くことを支援します。たとえば、 pydoc モジュールはモジュールの内容からドキュメントを生成します。 doctest と unittest モジュールでは、自動的に実行して予想通りの出力が生成されるか確認する ... ル クラスとモジュールのフィクスチャ setUpClass と tearDownClass setUpModule と tearDownModule シグナルハンドリング unittest.mock --- モックオブジェクトライブラリ クイックガイド Mock クラス 呼び出し 属性の削除 Mock の名前と name 属性 属性として設定され ... をパッチする TEST_PREFIX patch デコレータをネストする どこにパッチするか デスクリプタやプロキシオブジェクトにパッチする MagicMock と magic method のサポート Magic Method をモックする Magic Mock ヘルパー sentinel DEFAULT call create_autospec ANY FILTER_ ... DIR mock_open autospec を使う モックの封印 side_effect 、 return_value 、 wraps の優先順位 unittest.mock --- 入門 Mock を使う モック ...
https://man.mtool.work/python/3.14/library/development.html
Python ドキュメントの目次 8133
Python ドキュメントの目次 What's New in Python What's new in Python 3.14 概要 -- リリースハイライト 新しい機能 PEP 649 と PEP 749 : アノテーションの遅延評価 PEP 734 : 複数インタープリタ機能が標準ライブラリに追加 PEP 750 : テンプレート文字列 ... signal socket socketserver sqlite3 ssl string subprocess sys time tkinter tracemalloc types unicodedata unittest unittest.mock urllib.parse uu uuid warnings xml xml.etree xmlrpc.server zipapp zipfile C API の変更 ビルドの変更 最適化 その他の CPython ... erver ssl statistics struct subprocess sys telnetlib time timeit tkinter traceback tracemalloc typing unicodedata unittest.mock urllib.request urllib.robotparser venv warnings winreg winsound xmlrpc.client zipfile zlib 最適化 ビルドならびに C API の変 ... の変更 sqlite3 subprocess sys sysconfig tarfile threading time timeit tkinter traceback types unicodedata unittest unittest.mock urllib wsgiref xmlrpc xml.sax zipfile その他のモジュールレベルの変更 最適化 ビルドならびに C API の変更 非推奨 新たなキーワ ...
https://man.mtool.work/python/3.14/contents.html
What's New In Python 3.6 8063
What's New In Python 3.6 エディタ : Elvis Pranskevichus < elvis @ magic . io >, Yury Selivanov < yury @ magic . io > この記事では 3.5 と比較した Python 3.6 の新機能を解説します。 Python 3.6 は2016年12月23日にリリースされました。 全詳細につい ... edata unicodedata モジュールが Unicode 9.0.0 のデータを使うようになりました。 (Contributed by Benjamin Peterson.) unittest.mock Mock クラスは、次の改善が行われました。 Mock.assert_called() と Mock.assert_called_once() は、mockオブジェクトが呼ばれたか ... どうかを確認します。 (Contributed by Amit Saha in bpo-26323 .) Mock.reset_mock() メソッドに、省略可能なキーワード専用引数 return_value と side_effect が追加されました。 (Contributed by Kusha ...
https://man.mtool.work/python/3.14/whatsnew/3.6.html
Pythonモジュール索引 8028
Pythonモジュール索引 _ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | z _ __future__ Future statement definitions __main__ The environment where top-level code is run. Covers command-line i ... pe hints (see :pep:`484`). u unicodedata Access the Unicode Database. unittest Unit testing framework for Python. unittest.mock Mock object library. urllib urllib.error Exception classes raised by urllib.request. urllib.parse Parse URLs into or assem ...
https://man.mtool.work/python/3.14/py-modindex.html
Python 標準ライブラリ 7993
Python 標準ライブラリ このライブラリリファレンスマニュアルは、Python に付属する標準ライブラリについて説明します。 Python の配布物に含まれることが多い、オプションのコンポーネントの一部も説明します。 別の文書である Python 言語リファレンス では ... プシステム Python 開発モード doctest --- 対話型の Python の例をテストする unittest --- ユニットテストフレームワーク unittest.mock --- モックオブジェクトライブラリ unittest.mock --- 入門 test --- Python の回帰テストパッケージ test.support --- Python テス ...
https://man.mtool.work/python/3.14/library/
変更履歴 7941
変更履歴 次の Python バージョン リリース日: XXXX-XX-XX セキュリティ gh-160499 : Fix unbounded memory growth in asyncio TLS connections when a peer stops reading but keeps sending records that make OpenSSL generate its own replies (such as T ... 988 : asyncio.print_call_graph() が同期ジェネレーターの位置でコールスタックを切り詰めなくなりました。 gh-156970 : unittest.mock.Mock.return_value の docstring を設定しました。 gh-156946 : パネルの解放中にユーザーポインターのファイナライザが実行された ... aluate_forward_ref() が、アノテーション機構の使用する内部名を漏らすことがあるバグを修正しました。 gh-150484 : Fix unittest.mock.mock_open() __exit__ raising TypeError when used with contextlib.ExitStack . gh-149816 : フリースレッドモードでリストを直列 ...
https://man.mtool.work/python/3.14/whatsnew/changelog.html
What's New In Python 3.5 7906
What's New In Python 3.5 エディタ : Elvis Pranskevichus < elvis @ magic . io >, Yury Selivanov < yury @ magic . io > この記事では 3.4 と比較した Python 3.5 の新機能を解説します。 Python 3.5 は2015年9月13日にリリースされました。 全詳細につい ... オプション --locals で、トレースバックにローカル変数を表示できます。 (Contributed by Robert Collins in bpo-22936 .) unittest.mock Mock クラスは、次の改善が行われました。 クラスのコンストラクタに unsafe パラメータが追加されました。 これにより、モックオブ ... ジェクトは "assert" で始まる属性名に対して AttributeError を送出します。 (Contributed by Kushal Das in bpo-21238 .) 新しい Mock.assert_not_called() メソッドで、モックオブジェクトが呼び出されていないことを確認できます。 (Contributed by Kushal Das in b ... po-21262 .) MagicMock クラスが __truediv__() 、 __divmod__() 、 __matmul__() 演算子に対応しました。 (Contributed by Johannes Baiter in bpo-20968 ...
https://man.mtool.work/python/3.14/whatsnew/3.5.html
tracemalloc --- メモリ割り当ての追跡 7872
tracemalloc --- メモリ割り当ての追跡 Added in version 3.4. ソースコード: Lib/tracemalloc.py tracemallocモジュールは、Python が割り当てたメモリブロックをトレースするためのデバッグツールです。このモジュールは以下の情報を提供します。 オブジェク ... . py : 1465 : size = 83.5 KiB ( + 83.5 KiB ), count = 109 ( + 109 ), average = 784 B / usr / lib / python3 .4 / unittest / mock . py : 491 : size = 77.7 KiB ( + 77.7 KiB ), count = 143 ( + 143 ), average = 557 B / usr / lib / python3 .4 / urllib / pa ...
https://man.mtool.work/python/3.14/library/tracemalloc.html
PREV 1 2 NEXT