-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathdoctest.po
2889 lines (2583 loc) · 151 KB
/
doctest.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2021, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Arjun Bareja <[email protected]>, 2017
# Nozomu Kaneko <[email protected]>, 2017
# Ryuichi Takano <[email protected]>, 2017
# Yoshinari Takaoka <[email protected]>, 2017
# 秘湯 <[email protected]>, 2017
# Arihiro TAKASE, 2017
# tomo, 2019
# Yusuke Miyazaki <[email protected]>, 2021
# Osamu NAKAMURA, 2021
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.9\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-01 05:02+0000\n"
"PO-Revision-Date: 2017-02-16 23:07+0000\n"
"Last-Translator: Osamu NAKAMURA, 2021\n"
"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/doctest.rst:2
msgid ":mod:`doctest` --- Test interactive Python examples"
msgstr ":mod:`doctest` --- 対話的な実行例をテストする"
#: ../../library/doctest.rst:12
msgid "**Source code:** :source:`Lib/doctest.py`"
msgstr "**ソースコード:** :source:`Lib/doctest.py`"
#: ../../library/doctest.rst:16
msgid ""
"The :mod:`doctest` module searches for pieces of text that look like "
"interactive Python sessions, and then executes those sessions to verify that "
"they work exactly as shown. There are several common ways to use doctest:"
msgstr ""
":mod:`doctest` モジュールは、対話的 Python セッションのように見えるテキストを"
"探し出し、セッションの内容を実行して、そこに書かれている通りに振舞うかを調べ"
"ます。 :mod:`doctest` は以下のような用途によく使われています:"
#: ../../library/doctest.rst:20
msgid ""
"To check that a module's docstrings are up-to-date by verifying that all "
"interactive examples still work as documented."
msgstr ""
"モジュールの docstring (ドキュメンテーション文字列) 中にある対話実行例のすべ"
"てが書かれている通りに動作するか検証することで、docstring の内容が最新かどう"
"かチェックする。"
#: ../../library/doctest.rst:23
msgid ""
"To perform regression testing by verifying that interactive examples from a "
"test file or a test object work as expected."
msgstr ""
"テストファイルやテストオブジェクト中の対話実行例が期待通りに動作するかを検証"
"することで、回帰テストを実現します。"
#: ../../library/doctest.rst:26
msgid ""
"To write tutorial documentation for a package, liberally illustrated with "
"input-output examples. Depending on whether the examples or the expository "
"text are emphasized, this has the flavor of \"literate testing\" or "
"\"executable documentation\"."
msgstr ""
"入出力例を豊富に使ったパッケージのチュートリアルドキュメントが書けます。入出"
"力例と解説文のどちらに注目するかによって、ドキュメントは「読めるテスト」にも"
"「実行できるドキュメント」にもなります。"
#: ../../library/doctest.rst:31
msgid "Here's a complete but small example module::"
msgstr "以下に完全かつ短い実行例を示します::"
#: ../../library/doctest.rst:88
msgid ""
"If you run :file:`example.py` directly from the command line, :mod:`doctest` "
"works its magic:"
msgstr ""
":file:`example.py` をコマンドラインから直接実行すると、 :mod:`doctest` はその"
"魔法を働かせます:"
#: ../../library/doctest.rst:96
msgid ""
"There's no output! That's normal, and it means all the examples worked. "
"Pass ``-v`` to the script, and :mod:`doctest` prints a detailed log of what "
"it's trying, and prints a summary at the end:"
msgstr ""
"出力は何もありません!しかしこれが正常で、すべての実行例が正しく動作すること"
"を意味しています。スクリプトに ``-v`` を与えると、 :mod:`doctest` は何を行お"
"うとしているのかを記録した詳細なログを出力し、最後にまとめを出力します:"
#: ../../library/doctest.rst:114
msgid "And so on, eventually ending with:"
msgstr "といった具合で、最後には:"
#: ../../library/doctest.rst:133
msgid ""
"That's all you need to know to start making productive use of :mod:"
"`doctest`! Jump in. The following sections provide full details. Note that "
"there are many examples of doctests in the standard Python test suite and "
"libraries. Especially useful examples can be found in the standard test "
"file :file:`Lib/test/test_doctest.py`."
msgstr ""
":mod:`doctest` の生産的な利用を始めるために知る必要があるのはこれだけです!さ"
"あやってみましょう。詳細な事柄は後続の各節ですべて説明しています。 doctest の"
"例は、標準の Python テストスイートやライブラリ中に沢山あります。標準のテスト"
"ファイル :file:`Lib/test/test_doctest.py` には、特に役に立つ例があります。"
#: ../../library/doctest.rst:143
msgid "Simple Usage: Checking Examples in Docstrings"
msgstr "簡単な利用法: docstring 中の実行例をチェックする"
#: ../../library/doctest.rst:145
msgid ""
"The simplest way to start using doctest (but not necessarily the way you'll "
"continue to do it) is to end each module :mod:`M` with::"
msgstr ""
"doctest を試す簡単な方法 (とはいえ、いつもそうする必要はないのですが) は、各"
"モジュール :mod:`M` の最後を、以下のようにして締めくくることです::"
#: ../../library/doctest.rst:152
msgid ":mod:`doctest` then examines docstrings in module :mod:`M`."
msgstr "こうすると、 :mod:`doctest` は :mod:`M` 中の docstring を検査します。"
#: ../../library/doctest.rst:154
msgid ""
"Running the module as a script causes the examples in the docstrings to get "
"executed and verified::"
msgstr ""
"モジュールをスクリプトとして実行すると、docstring 中の実行例が実行され、検証"
"されます::"
#: ../../library/doctest.rst:159
msgid ""
"This won't display anything unless an example fails, in which case the "
"failing example(s) and the cause(s) of the failure(s) are printed to stdout, "
"and the final line of output is ``***Test Failed*** N failures.``, where *N* "
"is the number of examples that failed."
msgstr ""
"docstring に書かれた実行例の実行が失敗しない限り、何も表示されません。失敗す"
"ると、失敗した実行例と、その原因が (場合によっては複数) 標準出力に印字され、"
"最後に ``***Test Failed*** N failures.`` という行を出力します。ここで、*N* は"
"失敗した実行例の数です。"
#: ../../library/doctest.rst:164
msgid "Run it with the ``-v`` switch instead::"
msgstr "一方、``-v`` スイッチをつけて走らせると::"
#: ../../library/doctest.rst:168
msgid ""
"and a detailed report of all examples tried is printed to standard output, "
"along with assorted summaries at the end."
msgstr ""
"実行を試みたすべての実行例について詳細に報告し、最後に各種まとめを行った内容"
"が標準出力に印字されます。"
#: ../../library/doctest.rst:171
msgid ""
"You can force verbose mode by passing ``verbose=True`` to :func:`testmod`, "
"or prohibit it by passing ``verbose=False``. In either of those cases, "
"``sys.argv`` is not examined by :func:`testmod` (so passing ``-v`` or not "
"has no effect)."
msgstr ""
"``verbose=True`` を :func:`testmod` に渡せば、詳細報告 (verbose) モードを強制"
"できます。また、 ``verbose=False`` にすれば禁止できます。どちらの場合にも、 :"
"func:`testmod` は ``sys.argv`` 上のスイッチを調べません。(したがって、 ``-"
"v`` をつけても効果はありません)。"
#: ../../library/doctest.rst:176
msgid ""
"There is also a command line shortcut for running :func:`testmod`. You can "
"instruct the Python interpreter to run the doctest module directly from the "
"standard library and pass the module name(s) on the command line::"
msgstr ""
":func:`testmod` を実行するコマンドラインショートカットもあります。 Python イ"
"ンタプリタに doctest モジュールを標準ライブラリから直接実行して、テストするモ"
"ジュール名をコマンドライン引数に与えます::"
#: ../../library/doctest.rst:182
msgid ""
"This will import :file:`example.py` as a standalone module and run :func:"
"`testmod` on it. Note that this may not work correctly if the file is part "
"of a package and imports other submodules from that package."
msgstr ""
"こうすると :file:`example.py` を単体モジュールとしてインポートして、それに対"
"して :func:`testmod` を実行します。このファイルがパッケージの一部で他のサブモ"
"ジュールをそのパッケージからインポートしている場合はうまく動かないことに注意"
"してください。"
#: ../../library/doctest.rst:186
msgid ""
"For more information on :func:`testmod`, see section :ref:`doctest-basic-"
"api`."
msgstr ""
":func:`testmod` の詳しい情報は :ref:`doctest-basic-api` 節を参照してくださ"
"い。"
#: ../../library/doctest.rst:192
msgid "Simple Usage: Checking Examples in a Text File"
msgstr "簡単な利用法: テキストファイル中の実行例をチェックする"
#: ../../library/doctest.rst:194
msgid ""
"Another simple application of doctest is testing interactive examples in a "
"text file. This can be done with the :func:`testfile` function::"
msgstr ""
"doctest のもう一つの簡単な用途は、テキストファイル中にある対話実行例に対する"
"テストです。これには :func:`testfile` 関数を使います::"
#: ../../library/doctest.rst:200
msgid ""
"That short script executes and verifies any interactive Python examples "
"contained in the file :file:`example.txt`. The file content is treated as "
"if it were a single giant docstring; the file doesn't need to contain a "
"Python program! For example, perhaps :file:`example.txt` contains this:"
msgstr ""
"この短いスクリプトは、 :file:`example.txt` というファイルの中に入っている対話"
"モードの Python 操作例すべてを実行して、その内容を検証します。ファイルの内容"
"は一つの巨大な docstring であるかのように扱われます; ファイルが Python プログ"
"ラムである必要はありません!例えば、 :file:`example.txt` には以下のような内容"
"が入っているとします:"
#: ../../library/doctest.rst:223
msgid ""
"Running ``doctest.testfile(\"example.txt\")`` then finds the error in this "
"documentation::"
msgstr ""
"``doctest.testfile(\"example.txt\")`` を実行すると、このドキュメント内のエ"
"ラーを見つけ出します::"
#: ../../library/doctest.rst:234
msgid ""
"As with :func:`testmod`, :func:`testfile` won't display anything unless an "
"example fails. If an example does fail, then the failing example(s) and the "
"cause(s) of the failure(s) are printed to stdout, using the same format as :"
"func:`testmod`."
msgstr ""
":func:`testmod` と同じく、 :func:`testfile` は実行例が失敗しない限り何も表示"
"しません。実行例が失敗すると、失敗した実行例とその原因が (場合によっては複"
"数) :func:`testmod` と同じ書式で標準出力に書き出されます。"
#: ../../library/doctest.rst:239
msgid ""
"By default, :func:`testfile` looks for files in the calling module's "
"directory. See section :ref:`doctest-basic-api` for a description of the "
"optional arguments that can be used to tell it to look for files in other "
"locations."
msgstr ""
"デフォルトでは、 :func:`testfile` は自分自身を呼び出したモジュールのあるディ"
"レクトリを探します。その他の場所にあるファイルを見に行くように :func:"
"`testfile` に指示するためのオプション引数についての説明は :ref:`doctest-"
"basic-api` 節を参照してください。"
#: ../../library/doctest.rst:243
msgid ""
"Like :func:`testmod`, :func:`testfile`'s verbosity can be set with the ``-"
"v`` command-line switch or with the optional keyword argument *verbose*."
msgstr ""
":func:`testmod` と同様に :func:`testfile` の冗長性 (verbosity) はコマンドライ"
"ンスイッチ ``-v`` またはオプションのキーワード引数 *verbose* によって指定でき"
"ます。"
#: ../../library/doctest.rst:247
msgid ""
"There is also a command line shortcut for running :func:`testfile`. You can "
"instruct the Python interpreter to run the doctest module directly from the "
"standard library and pass the file name(s) on the command line::"
msgstr ""
":func:`testfile` を実行するコマンドラインショートカットもあります。 Python イ"
"ンタプリタに doctest モジュールを標準ライブラリから直接実行して、テストするモ"
"ジュール名をコマンドライン引数に与えます::"
#: ../../library/doctest.rst:253
msgid ""
"Because the file name does not end with :file:`.py`, :mod:`doctest` infers "
"that it must be run with :func:`testfile`, not :func:`testmod`."
msgstr ""
"ファイル名が :file:`.py` で終っていないので、 :mod:`doctest` は :func:"
"`testmod` ではなく :func:`testfile` を使って実行するのだと判断します。"
#: ../../library/doctest.rst:256
msgid ""
"For more information on :func:`testfile`, see section :ref:`doctest-basic-"
"api`."
msgstr ""
":func:`testfile` の詳細は :ref:`doctest-basic-api` 節を参照してください。"
#: ../../library/doctest.rst:262
msgid "How It Works"
msgstr "doctest のからくり"
#: ../../library/doctest.rst:264
msgid ""
"This section examines in detail how doctest works: which docstrings it looks "
"at, how it finds interactive examples, what execution context it uses, how "
"it handles exceptions, and how option flags can be used to control its "
"behavior. This is the information that you need to know to write doctest "
"examples; for information about actually running doctest on these examples, "
"see the following sections."
msgstr ""
"この節では、doctest のからくり: どの docstring を見に行くのか、どのように対話"
"実行例を見つけ出すのか、どんな実行コンテキストを使うのか、例外をどう扱うか、"
"上記の振る舞いを制御するためにどのようなオプションフラグを使うか、について詳"
"しく吟味します。こうした情報は、doctest に対応した実行例を書くために必要な知"
"識です; 書いた実行例に対して実際に doctest を実行する上で必要な情報については"
"後続の節を参照してください。"
#: ../../library/doctest.rst:275
msgid "Which Docstrings Are Examined?"
msgstr "どの docstring が検証されるのか?"
#: ../../library/doctest.rst:277
msgid ""
"The module docstring, and all function, class and method docstrings are "
"searched. Objects imported into the module are not searched."
msgstr ""
"モジュールの docstring と、すべての関数、クラスおよびメソッドの docstring が"
"検索されます。モジュールに import されたオブジェクトは検索されません。"
#: ../../library/doctest.rst:280
msgid ""
"In addition, if ``M.__test__`` exists and \"is true\", it must be a dict, "
"and each entry maps a (string) name to a function object, class object, or "
"string. Function and class object docstrings found from ``M.__test__`` are "
"searched, and strings are treated as if they were docstrings. In output, a "
"key ``K`` in ``M.__test__`` appears with name ::"
msgstr ""
"加えて、``M.__test__`` が存在し、\"真の値を持つ\" 場合、この値は辞書でなけれ"
"ばならず、辞書の各エントリは (文字列の) 名前を関数オブジェクト、クラスオブ"
"ジェクト、または文字列へとマップします。``M.__test__`` から得られた関数および"
"クラスオブジェクトの docstring は、その名前がプライベートなものでも検索され、"
"文字列の場合にはそれが docstring であるかのように扱われます。出力においては、"
"``M.__test__`` におけるキー ``K`` は、以下の名前で表示されます ::"
#: ../../library/doctest.rst:288
msgid ""
"Any classes found are recursively searched similarly, to test docstrings in "
"their contained methods and nested classes."
msgstr ""
"検索中に見つかったクラスも同様に再帰的に検索が行われ、クラスに含まれているメ"
"ソッドおよびネストされたクラスについて docstring のテストが行われます。"
#: ../../library/doctest.rst:299
msgid "How are Docstring Examples Recognized?"
msgstr "docstring 内の実行例をどのように認識するのか?"
#: ../../library/doctest.rst:301
msgid ""
"In most cases a copy-and-paste of an interactive console session works fine, "
"but doctest isn't trying to do an exact emulation of any specific Python "
"shell."
msgstr ""
"ほとんどの場合、対話コンソールセッション上でのコピー/ペーストはうまく動作し"
"ます。とはいえ、:mod:`doctest` は特定の Python シェルの振る舞いを正確にエミュ"
"レーションしようとするわけではありません。"
#: ../../library/doctest.rst:326
msgid ""
"Any expected output must immediately follow the final ``'>>> '`` or ``'... "
"'`` line containing the code, and the expected output (if any) extends to "
"the next ``'>>> '`` or all-whitespace line."
msgstr ""
"コードを含む最後の ``'>>> '`` または ``'... '`` 行の直下に期待する出力結果が"
"置かれます。(出力結果がもしあれば) それは次の ``'>>> '`` 行か、すべて空白文字"
"の行まで続きます。"
#: ../../library/doctest.rst:330
msgid "The fine print:"
msgstr "詳細事項:"
#: ../../library/doctest.rst:332
msgid ""
"Expected output cannot contain an all-whitespace line, since such a line is "
"taken to signal the end of expected output. If expected output does contain "
"a blank line, put ``<BLANKLINE>`` in your doctest example each place a blank "
"line is expected."
msgstr ""
"期待する出力結果には、空白だけの行が入っていてはなりません。そのような行は期"
"待する出力結果の終了を表すと見なされるからです。もし期待する出力結果の内容に"
"空白行が入っている場合には、空白行が入るべき場所すべてに ``<BLANKLINE>`` を入"
"れてください。"
#: ../../library/doctest.rst:337
msgid ""
"All hard tab characters are expanded to spaces, using 8-column tab stops. "
"Tabs in output generated by the tested code are not modified. Because any "
"hard tabs in the sample output *are* expanded, this means that if the code "
"output includes hard tabs, the only way the doctest can pass is if the :"
"const:`NORMALIZE_WHITESPACE` option or :ref:`directive <doctest-directives>` "
"is in effect. Alternatively, the test can be rewritten to capture the output "
"and compare it to an expected value as part of the test. This handling of "
"tabs in the source was arrived at through trial and error, and has proven to "
"be the least error prone way of handling them. It is possible to use a "
"different algorithm for handling tabs by writing a custom :class:"
"`DocTestParser` class."
msgstr ""
"全てのタブ文字は 8 カラムのタブ位置でスペースに展開されます。テスト対象のコー"
"ドが作成した出力にあるタブは変更されません。出力例にあるどんなタブも展開 *さ"
"れる* ので、コードの出力がハードタブを含んでいた場合、 doctest が通るには :"
"const:`NORMALIZE_WHITESPACE` オプションか :ref:`directive <doctest-"
"directives>` を有効にするしかありません。そうする代わりに、テストが出力を読み"
"取りテストの一部として期待される値と正しく比較するように、テストを書き直すこ"
"ともできます。このソース中のタブの扱いは試行錯誤の結果であり、タブの扱いの中"
"で最も問題の起きにくいものだということが分かっています。タブの扱いについて"
"は、独自の :class:`DocTestParser` クラスを実装して、別のアルゴリズムを使うこ"
"ともできます。"
#: ../../library/doctest.rst:349
msgid ""
"Output to stdout is captured, but not output to stderr (exception tracebacks "
"are captured via a different means)."
msgstr ""
"標準出力への出力は取り込まれますが、標準エラーは取り込まれません (例外発生時"
"のトレースバックは別の方法で取り込まれます)。"
#: ../../library/doctest.rst:352
msgid ""
"If you continue a line via backslashing in an interactive session, or for "
"any other reason use a backslash, you should use a raw docstring, which will "
"preserve your backslashes exactly as you type them::"
msgstr ""
"対話セッションにおいて、バックスラッシュを用いて次の行に続ける場合や、その他"
"の理由でバックスラッシュを用いる場合、raw docstring を使ってバックスラッシュ"
"を入力どおりに扱わせるようにしなければなりません::"
#: ../../library/doctest.rst:361
msgid ""
"Otherwise, the backslash will be interpreted as part of the string. For "
"example, the ``\\n`` above would be interpreted as a newline character. "
"Alternatively, you can double each backslash in the doctest version (and not "
"use a raw string)::"
msgstr ""
"そうしない場合は、バックスラッシュは文字列の一部として解釈されます。例えば、"
"上の ``\\n`` は改行文字として解釈されてしまいます。それ以外の方法では、"
"doctest にあるバックスラッシュを二重にする (そして raw string を使わない) と"
"いう方法もあります::"
#: ../../library/doctest.rst:370
msgid "The starting column doesn't matter::"
msgstr "開始カラムはどこでもかまいません::"
#: ../../library/doctest.rst:377
msgid ""
"and as many leading whitespace characters are stripped from the expected "
"output as appeared in the initial ``'>>> '`` line that started the example."
msgstr ""
"期待する出力結果の先頭部にある空白文字列は、実行例の開始部分にあたる ``'>>> "
"'`` 行の先頭にある空白文字列と同じだけ取り除かれます。"
#: ../../library/doctest.rst:384
msgid "What's the Execution Context?"
msgstr "実行コンテキストとは何か?"
#: ../../library/doctest.rst:386
msgid ""
"By default, each time :mod:`doctest` finds a docstring to test, it uses a "
"*shallow copy* of :mod:`M`'s globals, so that running tests doesn't change "
"the module's real globals, and so that one test in :mod:`M` can't leave "
"behind crumbs that accidentally allow another test to work. This means "
"examples can freely use any names defined at top-level in :mod:`M`, and "
"names defined earlier in the docstring being run. Examples cannot see names "
"defined in other docstrings."
msgstr ""
"デフォルトでは、 :mod:`doctest` はテストを行うべき docstring を見つけるたび"
"に :mod:`M` のグローバル名前空間の *浅いコピー* を使い、テストの実行によって"
"モジュールの実際のグローバル名前空間を変更しないようにし、かつ :mod:`M` 内で"
"行ったテストが痕跡を残して偶発的に別のテストを誤って動作させないようにしてい"
"ます。したがって、実行例中では :mod:`M` 内のトップレベルで定義されたすべての"
"名前と、 docstring が動作する以前に定義された名前を自由に使えます。個々の実行"
"例は他の docstring 中で定義された名前を参照できません。"
#: ../../library/doctest.rst:394
msgid ""
"You can force use of your own dict as the execution context by passing "
"``globs=your_dict`` to :func:`testmod` or :func:`testfile` instead."
msgstr ""
":func:`testmod` や :func:`testfile` に ``globs=your_dict`` を渡し、自前の辞書"
"を実行コンテキストとして使うこともできます。"
#: ../../library/doctest.rst:401
msgid "What About Exceptions?"
msgstr "例外はどう扱えばよいか?"
#: ../../library/doctest.rst:403
msgid ""
"No problem, provided that the traceback is the only output produced by the "
"example: just paste in the traceback. [#]_ Since tracebacks contain details "
"that are likely to change rapidly (for example, exact file paths and line "
"numbers), this is one case where doctest works hard to be flexible in what "
"it accepts."
msgstr ""
"トレースバックが実行例によって生成される唯一の出力なら問題ありません。単にト"
"レースバックを貼り付けてください。[#]_ トレースバックには、頻繁に変更されがち"
"な情報 (例えばファイルパスや行番号など) が入っているものなので、これは受け入"
"れるテスト結果に柔軟性を持たせようと doctest が苦労している部分の一つです。"
#: ../../library/doctest.rst:409
msgid "Simple example::"
msgstr "簡単な例を示しましょう::"
#: ../../library/doctest.rst:416
msgid ""
"That doctest succeeds if :exc:`ValueError` is raised, with the ``list."
"remove(x): x not in list`` detail as shown."
msgstr ""
"この doctest は、 :exc:`ValueError` が送出され、その詳細情報が ``list."
"remove(x): x not in list`` である場合に成功します。"
#: ../../library/doctest.rst:419
msgid ""
"The expected output for an exception must start with a traceback header, "
"which may be either of the following two lines, indented the same as the "
"first line of the example::"
msgstr ""
"例外が発生したときの期待する出力はトレースバックヘッダから始まっていなければ"
"なりません。トレースバックの形式は以下の二通りの行のいずれかで、実行例の最初"
"の行と同じインデントでなければりません::"
#: ../../library/doctest.rst:426
msgid ""
"The traceback header is followed by an optional traceback stack, whose "
"contents are ignored by doctest. The traceback stack is typically omitted, "
"or copied verbatim from an interactive session."
msgstr ""
"トレースバックヘッダの後ろにトレースバックスタックが続いてもかまいませんが、"
"doctest はその内容を無視します。普通はトレースバックスタックを省略するか、対"
"話セッションからそのままコピーしてきます。"
#: ../../library/doctest.rst:430
msgid ""
"The traceback stack is followed by the most interesting part: the line(s) "
"containing the exception type and detail. This is usually the last line of "
"a traceback, but can extend across multiple lines if the exception has a "
"multi-line detail::"
msgstr ""
"トレースバックスタックの後ろにはもっとも有意義な部分、例外の型と詳細情報の"
"入った行があります。これは通常トレースバックの最後の行ですが、例外が複数行の"
"詳細情報を持っている場合、複数の行にわたることもあります::"
#: ../../library/doctest.rst:442
msgid ""
"The last three lines (starting with :exc:`ValueError`) are compared against "
"the exception's type and detail, and the rest are ignored."
msgstr ""
"上の例では、最後の 3 行 (:exc:`ValueError` から始まる行) における例外の型と詳"
"細情報だけが比較され、それ以外の部分は無視されます。"
#: ../../library/doctest.rst:445
msgid ""
"Best practice is to omit the traceback stack, unless it adds significant "
"documentation value to the example. So the last example is probably better "
"as::"
msgstr ""
"例外を扱うコツは、実行例をドキュメントとして読む上で明らかに価値のある情報で"
"ない限り、トレースバックスタックは省略する、ということです。したがって、先ほ"
"どの例は以下のように書くべきでしょう::"
#: ../../library/doctest.rst:455
msgid ""
"Note that tracebacks are treated very specially. In particular, in the "
"rewritten example, the use of ``...`` is independent of doctest's :const:"
"`ELLIPSIS` option. The ellipsis in that example could be left out, or could "
"just as well be three (or three hundred) commas or digits, or an indented "
"transcript of a Monty Python skit."
msgstr ""
"トレースバックの扱いは非常に特殊なので注意してください。特に、上の書き直した"
"実行例では、 ``...`` の扱いは doctest の :const:`ELLIPSIS` オプションとは独立"
"しています。この例での省略記号は何かの省略を表しているかもしれませんし、コン"
"マや数字が 3 個 (または 300 個) かもしれませんし、 Monty Python のスキットを"
"インデントして書き写したものかもしれません。"
#: ../../library/doctest.rst:461
msgid "Some details you should read once, but won't need to remember:"
msgstr ""
"以下の詳細はずっと覚えておく必要はないのですが、一度目を通しておいてください:"
#: ../../library/doctest.rst:463
msgid ""
"Doctest can't guess whether your expected output came from an exception "
"traceback or from ordinary printing. So, e.g., an example that expects "
"``ValueError: 42 is prime`` will pass whether :exc:`ValueError` is actually "
"raised or if the example merely prints that traceback text. In practice, "
"ordinary output rarely begins with a traceback header line, so this doesn't "
"create real problems."
msgstr ""
"doctest は期待する出力の出所が print 文なのか例外なのかを推測できません。した"
"がって、例えば期待する出力が ``ValueError: 42 is prime`` であるような実行例"
"は、 :exc:`ValueError` が実際に送出された場合と、万が一期待する出力と同じ文字"
"列を print した場合の両方で成功してしまいます。現実的には、通常の出力がトレー"
"スバックヘッダから始まることはないので、実際に問題になることはないでしょう。"
#: ../../library/doctest.rst:470
msgid ""
"Each line of the traceback stack (if present) must be indented further than "
"the first line of the example, *or* start with a non-alphanumeric character. "
"The first line following the traceback header indented the same and starting "
"with an alphanumeric is taken to be the start of the exception detail. Of "
"course this does the right thing for genuine tracebacks."
msgstr ""
"トレースバックスタック (がある場合) の各行は、実行例の最初の行よりも深くイン"
"デントされているか、*または* 英数文字以外で始まっていなければなりません。ト"
"レースバックヘッダ以後に現れる行のうち、インデントが等しく英数文字で始まる最"
"初の行は例外の詳細情報が書かれた行とみなされるからです。もちろん、本物のト"
"レースバックでは正しく動作します。"
#: ../../library/doctest.rst:476
msgid ""
"When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified, "
"everything following the leftmost colon and any module information in the "
"exception name is ignored."
msgstr ""
"doctest のオプション :const:`IGNORE_EXCEPTION_DETAIL` を指定した場合、最も左"
"端のコロン以後の全ての内容と、例外名の中の全てのモジュール情報が無視されま"
"す。"
#: ../../library/doctest.rst:480
msgid ""
"The interactive shell omits the traceback header line for some :exc:"
"`SyntaxError`\\ s. But doctest uses the traceback header line to "
"distinguish exceptions from non-exceptions. So in the rare case where you "
"need to test a :exc:`SyntaxError` that omits the traceback header, you will "
"need to manually add the traceback header line to your test example."
msgstr ""
"対話シェルでは、 :exc:`SyntaxError` の場合にトレースバックヘッダが省略される"
"ことがあります。しかし doctest にとっては、例外を例外でないものと区別するため"
"にトレースバックヘッダが必要です。そこで、トレースバックヘッダを省略するよう"
"な :exc:`SyntaxError` をテストする必要があるというごく稀なケースでは、実行例"
"にトレースバックヘッダを手作業で追加する必要があるでしょう。"
#: ../../library/doctest.rst:488
msgid ""
"For some :exc:`SyntaxError`\\ s, Python displays the character position of "
"the syntax error, using a ``^`` marker::"
msgstr ""
":exc:`SyntaxError` の場合、 Python は構文エラーの起きた場所を ``^`` マーカで"
"表示します::"
#: ../../library/doctest.rst:497
msgid ""
"Since the lines showing the position of the error come before the exception "
"type and detail, they are not checked by doctest. For example, the "
"following test would pass, even though it puts the ``^`` marker in the wrong "
"location::"
msgstr ""
"例外の型と詳細情報の前にエラー位置を示す行がくるため、doctest はこの行を調べ"
"ません。例えば、以下の例では、間違った場所に ``^`` マーカを入れても成功してし"
"まいます::"
#: ../../library/doctest.rst:513
msgid "Option Flags"
msgstr "オプションフラグ"
#: ../../library/doctest.rst:515
msgid ""
"A number of option flags control various aspects of doctest's behavior. "
"Symbolic names for the flags are supplied as module constants, which can be :"
"ref:`bitwise ORed <bitwise>` together and passed to various functions. The "
"names can also be used in :ref:`doctest directives <doctest-directives>`, "
"and may be passed to the doctest command line interface via the ``-o`` "
"option."
msgstr ""
"doctest の振る舞いは、数多くのオプションフラグによって様々な側面から制御され"
"ています。フラグのシンボル名はモジュールの定数として提供され、 :ref:`ビット単"
"位論理和 <bitwise>` でつないで様々な関数に渡すことができます。シンボル名は :"
"ref:`doctest directives <doctest-directives>` でも使用でき、doctest コマンド"
"ラインインターフェースに ``-o`` を通して与えることができます。"
#: ../../library/doctest.rst:521
msgid "The ``-o`` command line option."
msgstr "``-o`` コマンドラインオプション"
#: ../../library/doctest.rst:524
msgid ""
"The first group of options define test semantics, controlling aspects of how "
"doctest decides whether actual output matches an example's expected output:"
msgstr ""
"最初に説明するオプション群は、テストのセマンティクスを決めます。すなわち、実"
"際にテストを実行したときの出力と実行例中の期待する出力とが一致しているかどう"
"かを doctest がどのように判断するかを制御します:"
#: ../../library/doctest.rst:530
msgid ""
"By default, if an expected output block contains just ``1``, an actual "
"output block containing just ``1`` or just ``True`` is considered to be a "
"match, and similarly for ``0`` versus ``False``. When :const:"
"`DONT_ACCEPT_TRUE_FOR_1` is specified, neither substitution is allowed. The "
"default behavior caters to that Python changed the return type of many "
"functions from integer to boolean; doctests expecting \"little integer\" "
"output still work in these cases. This option will probably go away, but "
"not for several years."
msgstr ""
"デフォルトでは、期待する出力ブロックに単に ``1`` だけが入っており、実際の出力"
"ブロックに ``1`` または ``True`` だけが入っていた場合、これらの出力は一致して"
"いるとみなされます。 ``0`` と ``False`` の場合も同様です。 :const:"
"`DONT_ACCEPT_TRUE_FOR_1` を指定すると、こうした値の読み替えを行いません。デ"
"フォルトの挙動で読み替えを行うのは、最近の Python で多くの関数の戻り値型が整"
"数型からブール型に変更されたことに対応するためです; 読み替えを行う場合、\"通"
"常の整数\" の出力を期待する出力とするような doctest も動作します。このオプ"
"ションはそのうちなくなるでしょうが、ここ数年はそのままでしょう。"
#: ../../library/doctest.rst:542
msgid ""
"By default, if an expected output block contains a line containing only the "
"string ``<BLANKLINE>``, then that line will match a blank line in the actual "
"output. Because a genuinely blank line delimits the expected output, this "
"is the only way to communicate that a blank line is expected. When :const:"
"`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not allowed."
msgstr ""
"デフォルトでは、期待する出力ブロックに ``<BLANKLINE>`` だけの入った行がある場"
"合、その行は実際の出力における空行に一致するようになります。完全な空行を入れ"
"てしまうと期待する出力がそこで終わっているとみなされてしまうため、期待する出"
"力に空行を入れたい場合にはこの方法を使わなければなりません。 :const:"
"`DONT_ACCEPT_BLANKLINE` を指定すると、 ``<BLANKLINE>`` の読み替えを行わなくな"
"ります。"
#: ../../library/doctest.rst:551
msgid ""
"When specified, all sequences of whitespace (blanks and newlines) are "
"treated as equal. Any sequence of whitespace within the expected output "
"will match any sequence of whitespace within the actual output. By default, "
"whitespace must match exactly. :const:`NORMALIZE_WHITESPACE` is especially "
"useful when a line of expected output is very long, and you want to wrap it "
"across multiple lines in your source."
msgstr ""
"このフラグを指定すると、連続する空白 (空白と改行文字) は互いに等価であるとみ"
"なします。期待する出力における任意の空白列は実際の出力における任意の空白と一"
"致します。デフォルトでは、空白は厳密に一致しなければなりません。 :const:"
"`NORMALIZE_WHITESPACE` は、期待する出力の内容が非常に長いために、ソースコード"
"中でその内容を複数行に折り返して書きたい場合に特に便利です。"
#: ../../library/doctest.rst:562
msgid ""
"When specified, an ellipsis marker (``...``) in the expected output can "
"match any substring in the actual output. This includes substrings that "
"span line boundaries, and empty substrings, so it's best to keep usage of "
"this simple. Complicated uses can lead to the same kinds of \"oops, it "
"matched too much!\" surprises that ``.*`` is prone to in regular expressions."
msgstr ""
"このフラグを指定すると、期待する出力中の省略記号マーカ (``...``) が実際の出力"
"中の任意の部分文字列と一致するようになります。部分文字列は行境界にわたるもの"
"や空文字列を含みます。したがって、このフラグを使うのは単純な内容を対象にする"
"場合にとどめましょう。複雑な使い方をすると、正規表現に ``.*`` を使ったときの"
"ように \"しまった、マッチしすぎた! (match too much!)\" と驚くことになりかね"
"ません。"
#: ../../library/doctest.rst:571
msgid ""
"When specified, an example that expects an exception passes if an exception "
"of the expected type is raised, even if the exception detail does not "
"match. For example, an example expecting ``ValueError: 42`` will pass if "
"the actual exception raised is ``ValueError: 3*14``, but will fail, e.g., "
"if :exc:`TypeError` is raised."
msgstr ""
"このフラグを指定すると、期待する実行結果に例外が入るような実行例で、期待通り"
"の型の例外が送出された場合に、例外の詳細情報が一致していなくてもテストが成功"
"します。例えば、期待する出力が ``ValueError: 42`` であるような実行例は、実際"
"に送出された例外が ``ValueError: 3*14`` でも成功しますが、 :exc:`TypeError` "
"が送出されるといった場合には成功しません。"
#: ../../library/doctest.rst:577
msgid ""
"It will also ignore the module name used in Python 3 doctest reports. Hence "
"both of these variations will work with the flag specified, regardless of "
"whether the test is run under Python 2.7 or Python 3.2 (or later versions)::"
msgstr ""
"また Python 3 の doctest レポートにあるモジュール名も無視します。従ってこのフ"
"ラグを指定すると、テストを Python 2.7 と Python 3.2 (もしくはそれ以降) のどち"
"らで行ったかに関係無く、どちらに対しても正しく動作します::"
#: ../../library/doctest.rst:589
msgid ""
"Note that :const:`ELLIPSIS` can also be used to ignore the details of the "
"exception message, but such a test may still fail based on whether or not "
"the module details are printed as part of the exception name. Using :const:"
"`IGNORE_EXCEPTION_DETAIL` and the details from Python 2.3 is also the only "
"clear way to write a doctest that doesn't care about the exception detail "
"yet continues to pass under Python 2.3 or earlier (those releases do not "
"support :ref:`doctest directives <doctest-directives>` and ignore them as "
"irrelevant comments). For example::"
msgstr ""
"なお、 :const:`ELLIPSIS` を使っても例外メッセージの詳細を無視することができま"
"すが、モジュールの詳細が例外名の一部として表示されるかどうかに依存するような"
"テストは、やはり失敗します。また、 :const:`IGNORE_EXCEPTION_DETAIL` と "
"Python 2.3 の詳細情報を使うことが、例外の詳細に影響されず、なおかつ Python "
"2.3 以前の Python (これらのリリースは :ref:`doctest ディレクティブ <doctest-"
"directives>` をサポートせず、これらを無関係なコメントとして無視します) で成功"
"する doctest を書くための、唯一の明確な方法です。例えば、例外の詳細情報は "
"2.4 で変更され、 \"doesn't\" の代わりに \"does not\" と書くようになりました"
"が::"
#: ../../library/doctest.rst:603
msgid ""
"passes under Python 2.3 and later Python versions with the flag specified, "
"even though the detail changed in Python 2.4 to say \"does not\" instead of "
"\"doesn't\"."
msgstr ""
"とすると、Python 2.3 やPython 2.4以降の Python バージョンでテストを成功させる"
"ことができます。"
#: ../../library/doctest.rst:607
msgid ""
":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating "
"to the module containing the exception under test."
msgstr ""
":mod:`doctest` モジュールの :const:`IGNORE_EXCEPTION_DETAIL` フラグが、 テス"
"トされている例外を含むモジュールの名前を無視するようになりました。"
#: ../../library/doctest.rst:614
msgid ""
"When specified, do not run the example at all. This can be useful in "
"contexts where doctest examples serve as both documentation and test cases, "
"and an example should be included for documentation purposes, but should not "
"be checked. E.g., the example's output might be random; or the example "
"might depend on resources which would be unavailable to the test driver."
msgstr ""
"このフラグを指定すると、実行例は一切実行されません。こうした機能は doctest の"
"実行例がドキュメントとテストを兼ねていて、ドキュメントのためには含めておかな"
"ければならないけれどチェックされなくても良い、というような文脈で役に立ちま"
"す。例えば、実行例の出力がランダムであるとか、テストドライバーには利用できな"
"いリソースに依存している場合などです。"
#: ../../library/doctest.rst:620
msgid ""
"The SKIP flag can also be used for temporarily \"commenting out\" examples."
msgstr "SKIP フラグは一時的に実行例を\"コメントアウト\"するのにも使えます。"
#: ../../library/doctest.rst:625
msgid "A bitmask or'ing together all the comparison flags above."
msgstr "上記の比較フラグすべての論理和をとったビットマスクです。"
#: ../../library/doctest.rst:627
msgid "The second group of options controls how test failures are reported:"
msgstr "二つ目のオプション群は、テストの失敗を報告する方法を制御します:"
#: ../../library/doctest.rst:632
msgid ""
"When specified, failures that involve multi-line expected and actual outputs "
"are displayed using a unified diff."
msgstr ""
"このオプションを指定すると、期待する出力および実際の出力が複数行になるときに"
"テストの失敗結果を unified diff 形式を使って表示します。"
#: ../../library/doctest.rst:638
msgid ""
"When specified, failures that involve multi-line expected and actual outputs "
"will be displayed using a context diff."
msgstr ""
"このオプションを指定すると、期待する出力および実際の出力が複数行になるときに"
"テストの失敗結果を context diff 形式を使って表示します。"
#: ../../library/doctest.rst:644
msgid ""
"When specified, differences are computed by ``difflib.Differ``, using the "
"same algorithm as the popular :file:`ndiff.py` utility. This is the only "
"method that marks differences within lines as well as across lines. For "
"example, if a line of expected output contains digit ``1`` where actual "
"output contains letter ``l``, a line is inserted with a caret marking the "
"mismatching column positions."
msgstr ""
"このオプションを指定すると、期待する出力と実際の出力との間の差分を ``difflib."
"Differ`` を使って算出します。使われているアルゴリズムは有名な :file:`ndiff."
"py` ユーティリティと同じです。これは、行単位の差分と同じように行内の差分に"
"マーカをつけられるようにする唯一の手段です。例えば、期待する出力のある行に数"
"字の ``1`` が入っていて、実際の出力には ``l`` が入っている場合、不一致の起き"
"ているカラム位置を示すキャレットの入った行が一行挿入されます。"
#: ../../library/doctest.rst:653
msgid ""
"When specified, display the first failing example in each doctest, but "
"suppress output for all remaining examples. This will prevent doctest from "
"reporting correct examples that break because of earlier failures; but it "
"might also hide incorrect examples that fail independently of the first "
"failure. When :const:`REPORT_ONLY_FIRST_FAILURE` is specified, the "
"remaining examples are still run, and still count towards the total number "
"of failures reported; only the output is suppressed."
msgstr ""
"このオプションを指定すると、各 doctest で最初にエラーの起きた実行例だけを表示"
"し、それ以後の実行例の出力を抑制します。これにより、正しく書かれた実行例が、"
"それ以前の実行例の失敗によっておかしくなってしまった場合に、 doctest がそれを"
"報告しないようになります。とはいえ、最初に失敗を引き起こした実行例とは関係な"
"く誤って書かれた実行例の報告も抑制してしまいます。 :const:"
"`REPORT_ONLY_FIRST_FAILURE` を指定した場合、実行例がどこかで失敗しても、それ"
"以後の実行例を続けて実行し、失敗したテストの総数を報告します; 出力が抑制され"
"るだけです。"
#: ../../library/doctest.rst:664
msgid ""
"When specified, exit after the first failing example and don't attempt to "
"run the remaining examples. Thus, the number of failures reported will be at "
"most 1. This flag may be useful during debugging, since examples after the "
"first failure won't even produce debugging output."
msgstr ""
"このオプションを指定すると、最初に実行例が失敗した時点で終了し、残りの実行例"
"を実行しません。つまり、報告される失敗の数はたかだか 1 つになります。最初の失"
"敗より後の例はデバッグ出力を生成しないため、このフラグはデバッグの際に有用で"
"しょう。"
#: ../../library/doctest.rst:669
msgid ""
"The doctest command line accepts the option ``-f`` as a shorthand for ``-o "
"FAIL_FAST``."
msgstr ""
"doctest コマンドラインは ``-f`` を ``-o FAIL_FAST`` の短縮形として受け付けま"
"す。"
#: ../../library/doctest.rst:677
msgid "A bitmask or'ing together all the reporting flags above."
msgstr "上記のエラー報告に関するフラグすべての論理和をとったビットマスクです。"
#: ../../library/doctest.rst:680
msgid ""
"There is also a way to register new option flag names, though this isn't "
"useful unless you intend to extend :mod:`doctest` internals via subclassing:"
msgstr ""
"サブクラス化で :mod:`doctest` 内部を拡張するつもりがなければ役に立ちません"
"が、別の新しいオプションフラグ名を登録する方法もあります:"
#: ../../library/doctest.rst:686
msgid ""
"Create a new option flag with a given name, and return the new flag's "
"integer value. :func:`register_optionflag` can be used when subclassing :"
"class:`OutputChecker` or :class:`DocTestRunner` to create new options that "
"are supported by your subclasses. :func:`register_optionflag` should always "
"be called using the following idiom::"
msgstr ""
"名前 *name* の新たなオプションフラグを作成し、作成されたフラグの整数値を返し"
"ます。 :func:`register_optionflag` は :class:`OutputChecker` や :class:"
"`DocTestRunner` をサブクラス化して、その中で新たに作成したオプションをサポー"
"トさせる際に使います。 :func:`register_optionflag` は以下のような定形文で呼び"
"出さなければなりません::"
#: ../../library/doctest.rst:702
msgid "Directives"
msgstr "ディレクティブ (Directives)"
#: ../../library/doctest.rst:704
msgid ""
"Doctest directives may be used to modify the :ref:`option flags <doctest-"
"options>` for an individual example. Doctest directives are special Python "
"comments following an example's source code:"
msgstr ""
"doctest ディレクティブは個々の実行例の :ref:`オプションフラグ <doctest-"
"options>` を操作するために使われます。 doctest ディレクティブは後のソースコー"
"ド例にあるような特殊な Python コメントです:"
#: ../../library/doctest.rst:715
msgid ""
"Whitespace is not allowed between the ``+`` or ``-`` and the directive "
"option name. The directive option name can be any of the option flag names "
"explained above."
msgstr ""
"``+`` や ``-`` とディレクティブオプション名の間に空白を入れてはなりません。"
"ディレクティブオプション名は上で説明したオプションフラグ名のいずれかです。"
#: ../../library/doctest.rst:719
msgid ""
"An example's doctest directives modify doctest's behavior for that single "
"example. Use ``+`` to enable the named behavior, or ``-`` to disable it."
msgstr ""
"ある実行例の doctest ディレクティブは、その実行例だけの doctest の振る舞いを"
"変えます。ある特定の挙動を有効にしたければ ``+`` を、無効にしたければ ``-`` "
"を使います。"
#: ../../library/doctest.rst:722
msgid "For example, this test passes::"
msgstr "例えば、以下のテストは成功します::"
#: ../../library/doctest.rst:728
msgid ""
"Without the directive it would fail, both because the actual output doesn't "
"have two blanks before the single-digit list elements, and because the "
"actual output is on a single line. This test also passes, and also requires "
"a directive to do so::"
msgstr ""
"ディレクティブがない場合、実際の出力には一桁の数字の間に二つスペースが入って"
"いないこと、実際の出力は 1 行になることから、テストは成功しないはずです。別の"
"ディレクティブを使って、このテストを成功させることもできます::"
#: ../../library/doctest.rst:736
msgid ""
"Multiple directives can be used on a single physical line, separated by "
"commas::"
msgstr ""
"複数のディレクティブは、一つの物理行の中にコンマで区切って指定できます::"
#: ../../library/doctest.rst:742
msgid ""
"If multiple directive comments are used for a single example, then they are "
"combined::"
msgstr ""
"一つの実行例中で複数のディレクティブコメントを使った場合、それらは組み合わさ"