Python 3.6.5 ドキュメント 検索

phrase: max: clip:
target: order:
Results of 1 - 10 of about 40 for assert (0.011 sec.)
26.6. unittest.mock --- 入門 — Python 3.6.5 ドキュメント 14463
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... では real.method )が利用された場合、どう使われたかを assert できるようにする属性やメソッドがモックにあります。 ... ると、その called 属性が True に設定されます。そして assert_called_with() や assert_called_once_with() メソッド ... ock () >>> real . method () >>> real . something . assert_called_once_with ( 1 , 2 , 3 ) 26.6.1.2. オブジェク ... k () >>> real . closer ( mock ) >>> mock . close . assert_called_with () モックに close メソッドを持たせるた ...
https://man.plustar.jp/python/library/unittest.mock-examples.html - [similar]
26.5. unittest.mock --- モックオブジェクトライブラリ — Python 3.6.5 ドキュメン... 14463
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... 'record -> replay' パターンの代わりに、 'action -> assertion' パターンに基づいています。 There is a backport ... 3 , 4 , 5 , key = 'value' ) 3 >>> thing . method . assert_called_with ( 3 , 4 , 5 , key = 'value' ) side_eff ... ule . ClassName1 () ... module . ClassName2 () ... assert MockClass1 is module . ClassName1 ... assert MockC ... lass2 is module . ClassName2 ... assert MockClass1 . called ... assert MockClass2 . called ...
https://man.plustar.jp/python/library/unittest.mock.html - [similar]
26.8. test --- Python 用回帰テストパッケージ — Python 3.6.5 ドキュメント 8440
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... ベースのテストでは廃止予定で、 unittest.TestCase の assertXXX メソッドが推奨されます。 exception test.support ... ーは次のようにして使います: with check_warnings (( "assertion is always true" , SyntaxWarning ), ( "" , UserW ... arning )): exec ( 'assert(False, "Hey!")' ) warnings . warn ( UserWarning ( ... ( quiet = True ) as w : warnings . warn ( "foo" ) assert str ( w . args [ 0 ]) == "foo" warnings . warn ( " ...
https://man.plustar.jp/python/library/test.html - [similar]
7. 単純文 (simple statement) — Python 3.6.5 ドキュメント 8222
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 言語リファレ ... は以下の通りです: simple_stmt ::= expression_stmt | assert_stmt | assignment_stmt | augmented_assignment_stmt ... 数と属性のアノテーション文法 PEP 484 - 型ヒント 7.3. assert 文 ¶ assert 文は、プログラム内にデバッグ用アサーシ ... ョン (debugging assertion) を仕掛けるための便利な方法です: assert_stmt :: ... = "assert" expression ["," expression ] 単純な形式 assert ex ...
https://man.plustar.jp/python/reference/simple_stmts.html - [similar]
8.8. weakref --- 弱参照 — Python 3.6.5 ドキュメント 8113
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... . finalize ( obj , callback , 1 , 2 , z = 3 ) >>> assert f . alive >>> assert f () == 6 CALLBACK >>> assert ... 'z': 3}) >>> newobj , func , args , kwargs = _ >>> assert not f . alive >>> assert newobj is obj >>> assert ...
https://man.plustar.jp/python/library/weakref.html - [similar]
12.6. sqlite3 --- SQLite データベースに対する DB-API 2.0 インタフェース — Pytho... 8003
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... "select ?" , ( AUSTRIA ,)) row = cur . fetchone () assert row [ 0 ] == AUSTRIA # but we can make sqlite3 alw ... "select ?" , ( AUSTRIA ,)) row = cur . fetchone () assert type ( row [ 0 ]) is bytes # the bytestrings will ... 8, unless you stored garbage in the # database ... assert row [ 0 ] == AUSTRIA . encode ( "utf-8" ) # we can ... ( "select ?" , ( "bar" ,)) row = cur . fetchone () assert row [ 0 ] == "barfoo" total_changes ¶ データベース ...
https://man.plustar.jp/python/library/sqlite3.html - [similar]
10. 完全な文法仕様 — Python 3.6.5 ドキュメント 8003
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 言語リファレ ... stmt | import_stmt | global_stmt | nonlocal_stmt | assert_stmt ) expr_stmt : testlist_star_expr ( annassign ... ) * nonlocal_stmt : 'nonlocal' NAME ( ',' NAME ) * assert_stmt : 'assert' test [ ',' test ] compound_stmt : ...
https://man.plustar.jp/python/reference/grammar.html - [similar]
26.4. unittest --- ユニットテストフレームワーク — Python 3.6.5 ドキュメント 7676
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... より軽量な構文でテストを書くことができます。例えば、 assert func(10) == 42 のように書きます。 The Python Testi ... test . TestCase ): def test_upper ( self ): self . assertEqual ( 'foo' . upper (), 'FOO' ) def test_isupper ... ( self ): self . assertTrue ( 'FOO' . isupper ()) self . assertFalse ( 'Fo ... def test_split ( self ): s = 'hello world' self . assertEqual ( s . split (), [ 'hello' , 'world' ]) # chec ...
https://man.plustar.jp/python/library/unittest.html - [similar]
29.5. warnings --- 警告の制御 — Python 3.6.5 ドキュメント 7629
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... ) # Trigger a warning. fxn () # Verify some things assert len ( w ) == 1 assert issubclass ( w [ - 1 ] . cat ... egory , DeprecationWarning ) assert "deprecated" in str ( w [ - 1 ] . message ) always ...
https://man.plustar.jp/python/library/warnings.html - [similar]
29.7. abc --- 抽象基底クラス — Python 3.6.5 ドキュメント 7520
ナビゲーション 索引 モジュール | 次へ | 前へ | Python » 3.6.5 ドキュメント » Python 標準ライブラ ... ass MyABC ( ABC ): pass MyABC . register ( tuple ) assert issubclass ( tuple , MyABC ) assert isinstance (() ...
https://man.plustar.jp/python/library/abc.html - [similar]
PREV 1 2 3 4 NEXT