@@ -150,6 +150,8 @@ msgid ""
150150"$ python example.py\n"
151151"$"
152152msgstr ""
153+ "$ python example.py\n"
154+ "$"
153155
154156#: ../../library/doctest.rst:96
155157msgid ""
@@ -222,6 +224,8 @@ msgid ""
222224"The simplest way to start using doctest (but not necessarily the way you'll "
223225"continue to do it) is to end each module :mod:`!M` with::"
224226msgstr ""
227+ "doctest を試す簡単な方法 (とはいえ、いつもそうする必要はないのですが) は、各"
228+ "モジュール :mod:`!M` の最後を、以下のようにして締めくくることです::"
225229
226230#: ../../library/doctest.rst:152
227231msgid ""
@@ -233,6 +237,7 @@ msgstr ""
233237#: ../../library/doctest.rst:156
234238msgid ":mod:`!doctest` then examines docstrings in module :mod:`!M`."
235239msgstr ""
240+ "こうすると、 :mod:`!doctest` は :mod:`!M` 中の docstring を検査します。"
236241
237242#: ../../library/doctest.rst:158
238243msgid ""
@@ -244,7 +249,7 @@ msgstr ""
244249
245250#: ../../library/doctest.rst:161
246251msgid "python M.py"
247- msgstr ""
252+ msgstr "python M.py "
248253
249254#: ../../library/doctest.rst:163
250255msgid ""
@@ -264,7 +269,7 @@ msgstr "一方、``-v`` スイッチをつけて走らせると::"
264269
265270#: ../../library/doctest.rst:170
266271msgid "python M.py -v"
267- msgstr ""
272+ msgstr "python M.py -v "
268273
269274#: ../../library/doctest.rst:172
270275msgid ""
@@ -317,6 +322,8 @@ msgid ""
317322"import doctest\n"
318323"doctest.testfile(\" example.txt\" )"
319324msgstr ""
325+ "import doctest\n"
326+ "doctest.testfile(\" example.txt\" )"
320327
321328#: ../../library/doctest.rst:197
322329msgid ""
@@ -416,7 +423,7 @@ msgstr ""
416423
417424#: ../../library/doctest.rst:253
418425msgid "Command-line Usage"
419- msgstr ""
426+ msgstr "コマンドラインでの使用 "
420427
421428#: ../../library/doctest.rst:255
422429msgid ""
@@ -425,7 +432,7 @@ msgstr ""
425432
426433#: ../../library/doctest.rst:257
427434msgid "python -m doctest [-v] [-o OPTION] [-f] file [file ...]"
428- msgstr ""
435+ msgstr "python -m doctest [-v] [-o OPTION] [-f] file [file ...] "
429436
430437#: ../../library/doctest.rst:265
431438msgid ""
@@ -435,14 +442,18 @@ msgstr ""
435442
436443#: ../../library/doctest.rst:268
437444msgid "python -m doctest -v example.py"
438- msgstr ""
445+ msgstr "python -m doctest -v example.py "
439446
440447#: ../../library/doctest.rst:270
441448msgid ""
442449"This will import :file:`example.py` as a standalone module and run :func:"
443450"`testmod` on it. Note that this may not work correctly if the file is part "
444451"of a package and imports other submodules from that package."
445452msgstr ""
453+ "こうすると :file:`example.py` を単体モジュールとしてインポートして、それに対"
454+ "して :func:`testmod` を実行します。このファイルがパッケージの一部で他のサブモ"
455+ "ジュールをそのパッケージからインポートしている場合はうまく動かないことに注意"
456+ "してください。"
446457
447458#: ../../library/doctest.rst:274
448459msgid ""
@@ -452,7 +463,7 @@ msgstr ""
452463
453464#: ../../library/doctest.rst:277
454465msgid "python -m doctest -v example.txt"
455- msgstr ""
466+ msgstr "python -m doctest -v example.txt "
456467
457468#: ../../library/doctest.rst:281
458469msgid ""
@@ -709,6 +720,13 @@ msgid ""
709720"names defined earlier in the docstring being run. Examples cannot see names "
710721"defined in other docstrings."
711722msgstr ""
723+ "デフォルトでは、 :mod:`doctest` はテストを行うべき docstring を見つけるたび"
724+ "に :mod:`!M` のグローバル名前空間の *浅いコピー* を使い、テストの実行によって"
725+ "モジュールの実際のグローバル名前空間を変更しないようにし、かつ :mod:`!M` 内で"
726+ "行ったテストが痕跡を残して偶発的に別のテストを誤って動作させないようにしてい"
727+ "ます。したがって、実行例中では :mod:`!M` 内のトップレベルで定義されたすべての"
728+ "名前と、 docstring が動作する以前に定義された名前を自由に使えます。個々の実行"
729+ "例は他の docstring 中で定義された名前を参照できません。"
712730
713731#: ../../library/doctest.rst:447
714732msgid ""
@@ -1674,6 +1692,13 @@ msgid ""
16741692"*exclude_empty* argument to the newer :class:`DocTestFinder` constructor "
16751693"defaults to true."
16761694msgstr ""
1695+ "オプション引数 *exclude_empty* はデフォルトでは偽になっています。この値を真に"
1696+ "すると、doctest を持たないオブジェクトを考慮から外します。デフォルトの設定は"
1697+ "依存のバージョンとの互換性を考えたハックであり、:meth:`doctest.master."
1698+ "summarize <DocTestRunner.summarize>` と :func:`testmod` を合わせて利用してい"
1699+ "るようなコードでも、テスト実行例を持たないオブジェクトから出力を得るようにし"
1700+ "ています。新たに追加された :class:`DocTestFinder` のコンストラクタの "
1701+ "*exclude_empty* はデフォルトで真になります。"
16771702
16781703#: ../../library/doctest.rst:993
16791704msgid ""
@@ -1748,6 +1773,12 @@ msgid ""
17481773"discovery, include a :ref:`load_tests <load_tests-protocol>` function in "
17491774"your test module::"
17501775msgstr ""
1776+ "doctest が付けられたモジュールが大きくなるにつれ、全ての doctest を組織的に実"
1777+ "行したくなるでしょう。 :mod:`doctest` モジュールは 2 つの関数を提供してい"
1778+ "て、 :mod:`unittest` のテストスイートを作り、 doctest を含んだテキストファイ"
1779+ "ルを作成するのに使えます。 :mod:`unittest` のテストディスカバリと組み合わせる"
1780+ "には、テストモジュールに :ref:`load_tests <load_tests-protocol>` 関数を書いて"
1781+ "おいてください::"
17511782
17521783#: ../../library/doctest.rst:1029
17531784msgid ""
0 commit comments