Results of 1 - 10 of about 33 for calls (0.006 sec.)
- unittest.mock --- モックオブジェクトライブラリ 14438
- unittest.mock --- モックオブジェクトライブラリ Added in version 3.3. ソースコード: Lib/unittest/mock.py unittest.mock は Python でテストを行うためのライブラリです。 テスト対象のシステムの一部をモックオブジェクトに置き換え、どのように使われた
...nce () Traceback (most recent call last): ... AssertionError : Expected 'method' to have been called once. Called 2 times. Calls: [call(), call()]. Added in version 3.6. assert_called_with ( * args , ** kwargs ) このメソッドを使うと、最後の呼び出しが特...ar = 'values' ) Traceback (most recent call last): ... AssertionError : Expected 'mock' to be called once. Called 2 times. Calls: [call('foo', bar='baz'), call('other', bar='values')]. assert_any_call ( * args , ** kwargs ) assert the mock has been ca...2 , arg = 'thing' ) >>> mock ( 'some' , 'thing' , 'else' ) >>> mock . assert_any_call ( 1 , 2 , arg = 'thing' ) assert_has_calls ( calls , any_order = False ) assert the mock has been called with the specified calls. The mock_calls list is checked for... - https://man.mtool.work/python/3.14/library/unittest.mock.html
- unittest.mock --- 入門 12930
- unittest.mock --- 入門 Added in version 3.3. Mock を使う モックでメソッドにパッチを当てる 一般的な Mock の使い方の中には次のものがあります: メソッドにパッチを当てる オブジェクトに対するメソッド呼び出しを記録する システムの他の部分からメソッ
...ock name='foo.method' id='...'> すべての呼び出しを追跡する メソッドの複数回の呼び出しをトラックしたいことがあります。 mock_calls 属性は、そのモックの子属性やさらにその子孫に対する呼び出しすべてを記録しています。 >>> mock = MagicMock () >>> mock . meth...d='...'> >>> mock . attribute . method ( 10 , x = 53 ) <MagicMock name='mock.attribute.method()' id='...'> >>> mock . mock_calls [call.method(), call.attribute.method(10, x=53)] mock_calls に対して assert すると、予期していないメソッド呼び出しがあった...実行されたかどうかだけでなく、その呼び出し順序や期待した以外の呼び出しが起こらなかったことまでテストできるので便利です: mock_calls と比較するリストを作るために call オブジェクトを利用できます: >>> expected = [ call . method (), call . attribute . method... - https://man.mtool.work/python/3.14/library/unittest.mock-examples.html
- The Python Profilers 10925
- The Python Profilers Source code: Lib/profile.py and Lib/pstats.py Introduction to the profilers cProfile and profile provide deterministic profiling of Python programs. A profile is a set of statistics that describes how often and for how
...ilable on your system.) The above action would run re.compile() and print profile results like the following: 214 function calls ( 207 primitive calls ) in 0.002 seconds Ordered by : cumulative time ncalls tottime percall cumtime percall filename : li...ompiler . py : 598 ( _code ) 1 0.000 0.000 0.000 0.000 _parser . py : 435 ( _parse_sub ) The first line indicates that 214 calls were monitored. Of those calls, 207 were primitive , meaning that the call was not induced via recursion. The next line: O...rdered by: cumulative time indicates the output is sorted by the cumtime values. The column headings include: ncalls for the number of calls. tottime for the total time spent in the given function (and excluding time made in calls to sub-f... - https://man.mtool.work/python/3.14/library/profile.html
- DTrace と SystemTap で CPython を測定する 9016
- DTrace と SystemTap で CPython を測定する author : David Malcolm author : Łukasz Langa Dtrace と SystemTap はモニタリングツールで、コンピュータシステムのプロセスが何をしているかを調べる方法を提供します。 どちらもドメイン固有言語 (domain-spe
...p のように表示します。 システム全体で最も頻繁に実行が開始されたバイトコードフレームの上位 20 件を毎秒表示します: global fn_calls; probe python.function.entry { fn_calls[pid(), filename, funcname, lineno] += 1; } probe timer.ms(1000) { printf("\033[2J\...033[1;1H") /* clear screen \*/ printf("%6s %80s %6s %30s %6s\n", "PID", "FILENAME", "LINE", "FUNCTION", "CALLS") foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) { printf("%6d %80s %6d %30s %6d\n", pid, filename, lin...eno, funcname, fn_calls[pid, filename, funcname, lineno]); } delete fn_calls; } 他のマニュアルの関連ページ PHP features.dtrace.dtrace PHP features... - https://man.mtool.work/python/3.14/howto/instrumentation.html
- asyncio とフリースレッド Python 8085
- asyncio とフリースレッド Python asyncio uses an event loop as a scheduler to enable highly efficient concurrency by switching between tasks to allow non-blocking I/O operations. This results in better performance for I/O-bound use cases. It
...ly through queue.Queue . When the queue is empty the consumer sleeps briefly and tries again. When the producer is done it calls shutdown() , which causes subsequent get_nowait() calls to raise queue.ShutDown so the consumer can exit cleanly. 他のマニ... - https://man.mtool.work/python/3.14/library/asyncio-threading.html
- syslog --- Unix syslog ライブラリルーチン群 8085
- syslog --- Unix syslog ライブラリルーチン群 このモジュールは Unix の syslog ライブラリルーチンへのインターフェースを提供します。 syslog の機能の詳しい説明は、Unix のマニュアルページを参照してください。 利用可能な環境 : Unix, not WASI, not i
...l raise RuntimeError . syslog. openlog ( [ ident [ , logoption [ , facility ] ] ] ) Logging options of subsequent syslog() calls can be set by calling openlog() . syslog() will call openlog() with no arguments if the log is not currently open. オプショ...meError を送出します。 syslog. setlogmask ( maskpri ) Set the priority mask to maskpri and return the previous mask value. Calls to syslog() with a priority level not set in maskpri are ignored. The default is to log all priorities. The function LOG_M... - https://man.mtool.work/python/3.14/library/syslog.html
- xmlrpc.client --- XML-RPC クライアントアクセス 7925
- xmlrpc.client --- XML-RPC クライアントアクセス ソースコード: Lib/xmlrpc/client.py XML-RPCはXMLを利用した遠隔手続き呼び出し(Remote Procedure Call)の一種で、HTTP(S)をトランスポートとして使用します。XML- RPCでは、クライアントはリモートサーバ(U
...トにカプセル化する方法を提供します [ 1 ] 。 class xmlrpc.client. MultiCall ( server ) Create an object used to boxcar method calls. server is the eventual target of the call. Calls can be made to the result object, but they will immediately return None..., and only store the call name and parameters in the MultiCall object. Calling the object itself causes all stored calls to be transmitted as a single system.multicall request. The result of this call is a generator ; iterating over this gener... - https://man.mtool.work/python/3.14/library/xmlrpc.client.html
- Pythonモジュール索引 7925
- 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
...class. errno Standard errno system symbols. f faulthandler Dump the Python traceback. fcntl The fcntl() and ioctl() system calls. filecmp Compare files efficiently. fileinput Loop over standard input or a list of files. fnmatch Unix shell style filena...b Generate and parse Apple plist files. poplib POP3 protocol client (requires sockets). posix The most common POSIX system calls (normally used via module os). pprint Data pretty printer. profile Python source profiler. pstats Statistics object for us... - https://man.mtool.work/python/3.14/py-modindex.html
- デスクリプタ ガイド 7845
- デスクリプタ ガイド Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を使うと、オブジェクトの属性の検索、保存、削除をカスタマイズできます。 本ガイドは4つの大項目から構成されています。 最初の「入門」では基本の紹介をし
...ます。 クラスはこの機構を object 、 type 、 super() から継承する Overriding __getattribute__() prevents automatic descriptor calls because all the descriptor logic is in that method. object.__getattribute__() and type.__getattribute__() make different c...s' def __new__ ( mcls , clsname , bases , mapping , ** kwargs ): 'Emulate type_new() in Objects/typeobject.c' # type_new() calls PyTypeReady() which calls add_methods() slot_names = mapping . get ( 'slot_names' , []) for offset , name in enumerate ( s... - https://man.mtool.work/python/3.14/howto/descriptor.html
- timeit --- 小さなコードスニペットの実行時間計測 7764
- timeit --- 小さなコードスニペットの実行時間計測 ソースコード: Lib/timeit.py このモジュールは、小さな Python コードの実行時間を簡単に計測する手段を提供します。 Command-Line Interface と、 Python から呼び出せるインターフェース の両方があります
...timeit () autorange ( callback = None ) timeit() を呼び出す回数を自動的に決定します。 This is a convenience function that calls timeit() repeatedly so that the total time >= 0.2 second, returning the eventual (number of loops, time taken for that num...ber of loops). It calls timeit() with increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2 seconds.... - https://man.mtool.work/python/3.14/library/timeit.html