-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdoctest.po
More file actions
1466 lines (1087 loc) · 71.5 KB
/
Copy pathdoctest.po
File metadata and controls
1466 lines (1087 loc) · 71.5 KB
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 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alireza Shabani (Revisto) <[email protected]>, 2025
# Rafael Fontenelle <[email protected]>, 2025
# Sepehr Rasouli <[email protected]>, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-08-26 03:59+0000\n"
"PO-Revision-Date: 2021-06-28 01:04+0000\n"
"Last-Translator: Sepehr Rasouli <[email protected]>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid ":mod:`!doctest` --- Test interactive Python examples"
msgstr ""
msgid "**Source code:** :source:`Lib/doctest.py`"
msgstr ""
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 ""
msgid "To check that a module's docstrings are up-to-date by verifying that all interactive examples still work as documented."
msgstr ""
msgid "To perform regression testing by verifying that interactive examples from a test file or a test object work as expected."
msgstr ""
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 ""
msgid "Here's a complete but small example module::"
msgstr ""
msgid ""
"\"\"\"\n"
"This is the \"example\" module.\n"
"\n"
"The example module supplies one function, factorial(). For example,\n"
"\n"
">>> factorial(5)\n"
"120\n"
"\"\"\"\n"
"\n"
"def factorial(n):\n"
" \"\"\"Return the factorial of n, an exact integer >= 0.\n"
"\n"
" >>> [factorial(n) for n in range(6)]\n"
" [1, 1, 2, 6, 24, 120]\n"
" >>> factorial(30)\n"
" 265252859812191058636308480000000\n"
" >>> factorial(-1)\n"
" Traceback (most recent call last):\n"
" ...\n"
" ValueError: n must be >= 0\n"
"\n"
" Factorials of floats are OK, but the float must be an exact integer:\n"
" >>> factorial(30.1)\n"
" Traceback (most recent call last):\n"
" ...\n"
" ValueError: n must be exact integer\n"
" >>> factorial(30.0)\n"
" 265252859812191058636308480000000\n"
"\n"
" It must also not be ridiculously large:\n"
" >>> factorial(1e100)\n"
" Traceback (most recent call last):\n"
" ...\n"
" OverflowError: n too large\n"
" \"\"\"\n"
"\n"
" import math\n"
" if not n >= 0:\n"
" raise ValueError(\"n must be >= 0\")\n"
" if math.floor(n) != n:\n"
" raise ValueError(\"n must be exact integer\")\n"
" if n+1 == n: # catch a value like 1e300\n"
" raise OverflowError(\"n too large\")\n"
" result = 1\n"
" factor = 2\n"
" while factor <= n:\n"
" result *= factor\n"
" factor += 1\n"
" return result\n"
"\n"
"\n"
"if __name__ == \"__main__\":\n"
" import doctest\n"
" doctest.testmod()"
msgstr ""
msgid "If you run :file:`example.py` directly from the command line, :mod:`!doctest` works its magic:"
msgstr ""
msgid ""
"$ python example.py\n"
"$"
msgstr ""
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 ""
msgid ""
"$ python example.py -v\n"
"Trying:\n"
" factorial(5)\n"
"Expecting:\n"
" 120\n"
"ok\n"
"Trying:\n"
" [factorial(n) for n in range(6)]\n"
"Expecting:\n"
" [1, 1, 2, 6, 24, 120]\n"
"ok"
msgstr ""
msgid "And so on, eventually ending with:"
msgstr ""
msgid ""
"Trying:\n"
" factorial(1e100)\n"
"Expecting:\n"
" Traceback (most recent call last):\n"
" ...\n"
" OverflowError: n too large\n"
"ok\n"
"2 items passed all tests:\n"
" 1 test in __main__\n"
" 6 tests in __main__.factorial\n"
"7 tests in 2 items.\n"
"7 passed.\n"
"Test passed.\n"
"$"
msgstr ""
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/test_doctest.py`."
msgstr ""
msgid "Output is colorized by default and can be :ref:`controlled using environment variables <using-on-controlling-color>`."
msgstr ""
msgid "Simple Usage: Checking Examples in Docstrings"
msgstr ""
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 ""
msgid ""
"if __name__ == \"__main__\":\n"
" import doctest\n"
" doctest.testmod()"
msgstr ""
msgid ":mod:`!doctest` then examines docstrings in module :mod:`!M`."
msgstr ""
msgid "Running the module as a script causes the examples in the docstrings to get executed and verified::"
msgstr ""
msgid "python M.py"
msgstr ""
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 ""
msgid "Run it with the ``-v`` switch instead::"
msgstr ""
msgid "python M.py -v"
msgstr ""
msgid "and a detailed report of all examples tried is printed to standard output, along with assorted summaries at the end."
msgstr ""
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, :data:`sys.argv` is not examined by :func:`testmod` (so passing ``-v`` or not has no effect)."
msgstr ""
msgid "There is also a command line shortcut for running :func:`testmod`, see section :ref:`doctest-cli`."
msgstr ""
msgid "For more information on :func:`testmod`, see section :ref:`doctest-basic-api`."
msgstr ""
msgid "Simple Usage: Checking Examples in a Text File"
msgstr ""
msgid "Another simple application of doctest is testing interactive examples in a text file. This can be done with the :func:`testfile` function::"
msgstr ""
msgid ""
"import doctest\n"
"doctest.testfile(\"example.txt\")"
msgstr ""
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 ""
msgid ""
"The ``example`` module\n"
"======================\n"
"\n"
"Using ``factorial``\n"
"-------------------\n"
"\n"
"This is an example text file in reStructuredText format. First import\n"
"``factorial`` from the ``example`` module:\n"
"\n"
" >>> from example import factorial\n"
"\n"
"Now use it:\n"
"\n"
" >>> factorial(6)\n"
" 120"
msgstr ""
msgid "Running ``doctest.testfile(\"example.txt\")`` then finds the error in this documentation::"
msgstr ""
msgid ""
"File \"./example.txt\", line 14, in example.txt\n"
"Failed example:\n"
" factorial(6)\n"
"Expected:\n"
" 120\n"
"Got:\n"
" 720"
msgstr ""
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 ""
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 ""
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 ""
msgid "There is also a command line shortcut for running :func:`testfile`, see section :ref:`doctest-cli`."
msgstr ""
msgid "For more information on :func:`testfile`, see section :ref:`doctest-basic-api`."
msgstr ""
msgid "Command-line Usage"
msgstr ""
msgid "The :mod:`!doctest` module can be invoked as a script from the command line:"
msgstr ""
msgid "python -m doctest [-v] [-o OPTION] [-f] file [file ...]"
msgstr ""
msgid "Detailed report of all examples tried is printed to standard output, along with assorted summaries at the end::"
msgstr ""
msgid "python -m doctest -v example.py"
msgstr ""
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 ""
msgid "If the file name does not end with :file:`.py`, :mod:`!doctest` infers that it must be run with :func:`testfile` instead::"
msgstr ""
msgid "python -m doctest -v example.txt"
msgstr ""
msgid "Option flags control various aspects of doctest's behavior, see section :ref:`doctest-options`."
msgstr ""
msgid "This is shorthand for ``-o FAIL_FAST``."
msgstr ""
msgid "How It Works"
msgstr ""
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 ""
msgid "Which Docstrings Are Examined?"
msgstr ""
msgid "The module docstring, and all function, class and method docstrings are searched. Objects imported into the module are not searched."
msgstr ""
msgid "In addition, there are cases when you want tests to be part of a module but not part of the help text, which requires that the tests not be included in the docstring. Doctest looks for a module-level variable called ``__test__`` and uses it to locate other tests. If ``M.__test__`` exists, 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 ``M.__test__.K``."
msgstr ""
msgid "For example, place this block of code at the top of :file:`example.py`:"
msgstr ""
msgid ""
"__test__ = {\n"
" 'numbers': \"\"\"\n"
">>> factorial(6)\n"
"720\n"
"\n"
">>> [factorial(n) for n in range(6)]\n"
"[1, 1, 2, 6, 24, 120]\n"
"\"\"\"\n"
"}"
msgstr ""
msgid "The value of ``example.__test__[\"numbers\"]`` will be treated as a docstring and all the tests inside it will be run. It is important to note that the value can be mapped to a function, class object, or module; if so, :mod:`!doctest` searches them recursively for docstrings, which are then scanned for tests."
msgstr ""
msgid "Any classes found are recursively searched similarly, to test docstrings in their contained methods and nested classes."
msgstr ""
msgid "``doctest`` can only automatically discover classes and functions that are defined at the module level or inside other classes."
msgstr ""
msgid "Since nested classes and functions only exist when an outer function is called, they cannot be discovered. Define them outside to make them visible."
msgstr ""
msgid "How are Docstring Examples Recognized?"
msgstr ""
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 ""
msgid ""
">>> # comments are ignored\n"
">>> x = 12\n"
">>> x\n"
"12\n"
">>> if x == 13:\n"
"... print(\"yes\")\n"
"... else:\n"
"... print(\"no\")\n"
"... print(\"NO\")\n"
"... print(\"NO!!!\")\n"
"...\n"
"no\n"
"NO\n"
"NO!!!\n"
">>>"
msgstr ""
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 ""
msgid "The fine print:"
msgstr ""
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 ""
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 ""
msgid "Output to stdout is captured, but not output to stderr (exception tracebacks are captured via a different means)."
msgstr ""
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 ""
msgid ""
">>> def f(x):\n"
"... r'''Backslashes in a raw docstring: m\\n'''\n"
"...\n"
">>> print(f.__doc__)\n"
"Backslashes in a raw docstring: m\\n"
msgstr ""
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 ""
msgid ""
">>> def f(x):\n"
"... '''Backslashes in a raw docstring: m\\\\n'''\n"
"...\n"
">>> print(f.__doc__)\n"
"Backslashes in a raw docstring: m\\n"
msgstr ""
msgid "The starting column doesn't matter::"
msgstr ""
msgid ""
">>> assert \"Easy!\"\n"
" >>> import math\n"
" >>> math.floor(1.9)\n"
" 1"
msgstr ""
msgid "and as many leading whitespace characters are stripped from the expected output as appeared in the initial ``'>>> '`` line that started the example."
msgstr ""
msgid "What's the Execution Context?"
msgstr ""
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 ""
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 ""
msgid "What About Exceptions?"
msgstr ""
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 ""
msgid "Simple example::"
msgstr ""
msgid ""
">>> [1, 2, 3].remove(42)\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
"ValueError: list.remove(x): x not in list"
msgstr ""
msgid "That doctest succeeds if :exc:`ValueError` is raised, with the ``list.remove(x): x not in list`` detail as shown."
msgstr ""
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 ""
msgid ""
"Traceback (most recent call last):\n"
"Traceback (innermost last):"
msgstr ""
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 ""
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 ""
msgid ""
">>> raise ValueError('multi\\n line\\ndetail')\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 1, in <module>\n"
"ValueError: multi\n"
" line\n"
"detail"
msgstr ""
msgid "The last three lines (starting with :exc:`ValueError`) are compared against the exception's type and detail, and the rest are ignored."
msgstr ""
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 ""
msgid ""
">>> raise ValueError('multi\\n line\\ndetail')\n"
"Traceback (most recent call last):\n"
" ...\n"
"ValueError: multi\n"
" line\n"
"detail"
msgstr ""
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 ""
msgid "Some details you should read once, but won't need to remember:"
msgstr ""
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 ""
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 ""
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 ""
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 ""
msgid "For some exceptions, Python displays the position of the error using ``^`` markers and tildes::"
msgstr ""
msgid ""
">>> 1 + None\n"
" File \"<stdin>\", line 1\n"
" 1 + None\n"
" ~~^~~~~~\n"
"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'"
msgstr ""
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 ""
msgid ""
">>> 1 + None\n"
" File \"<stdin>\", line 1\n"
" 1 + None\n"
" ^~~~~~~~\n"
"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'"
msgstr ""
msgid "Option Flags"
msgstr ""
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 ""
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 ""
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 ""
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 ""
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 ""
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 ""
msgid "When specified, doctests expecting exceptions pass so long as an exception of the expected type is raised, even if the details (message and fully qualified exception name) don't match."
msgstr ""
msgid "For example, an example expecting ``ValueError: 42`` will pass if the actual exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:`TypeError` is raised instead. It will also ignore any fully qualified name included before the exception class, which can vary between implementations and versions of Python and the code/libraries in use. Hence, all three of these variations will work with the flag specified:"
msgstr ""
msgid ""
">>> raise Exception('message')\n"
"Traceback (most recent call last):\n"
"Exception: message\n"
"\n"
">>> raise Exception('message')\n"
"Traceback (most recent call last):\n"
"builtins.Exception: message\n"
"\n"
">>> raise Exception('message')\n"
"Traceback (most recent call last):\n"
"__main__.Exception: message"
msgstr ""
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 the module name is present or matches exactly."
msgstr ""
msgid ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating to the module containing the exception under test."
msgstr ""
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 ""
msgid "The SKIP flag can also be used for temporarily \"commenting out\" examples."
msgstr ""
msgid "A bitmask or'ing together all the comparison flags above."
msgstr ""
msgid "The second group of options controls how test failures are reported:"
msgstr ""
msgid "When specified, failures that involve multi-line expected and actual outputs are displayed using a unified diff."
msgstr ""
msgid "When specified, failures that involve multi-line expected and actual outputs will be displayed using a context diff."
msgstr ""
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 ""
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 ""
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 ""
msgid "A bitmask or'ing together all the reporting flags above."
msgstr ""
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 ""
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 ""
msgid "MY_FLAG = register_optionflag('MY_FLAG')"
msgstr ""
msgid "Directives"
msgstr ""
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 ""
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 ""
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 ""
msgid "For example, this test passes:"
msgstr ""
msgid ""
">>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE\n"
"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n"
"10, 11, 12, 13, 14, 15, 16, 17, 18, 19]"
msgstr ""
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 ""
msgid ""
">>> print(list(range(20))) # doctest: +ELLIPSIS\n"
"[0, 1, ..., 18, 19]"
msgstr ""
msgid "Multiple directives can be used on a single physical line, separated by commas:"
msgstr ""
msgid ""
">>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n"
"[0, 1, ..., 18, 19]"
msgstr ""
msgid "If multiple directive comments are used for a single example, then they are combined:"
msgstr ""
msgid ""
">>> print(list(range(20))) # doctest: +ELLIPSIS\n"
"... # doctest: +NORMALIZE_WHITESPACE\n"
"[0, 1, ..., 18, 19]"
msgstr ""
msgid "As the previous example shows, you can add ``...`` lines to your example containing only directives. This can be useful when an example is too long for a directive to comfortably fit on the same line:"
msgstr ""
msgid ""
">>> print(list(range(5)) + list(range(10, 20)) + list(range(30, 40)))\n"
"... # doctest: +ELLIPSIS\n"
"[0, ..., 4, 10, ..., 19, 30, ..., 39]"
msgstr ""
msgid "Note that since all options are disabled by default, and directives apply only to the example they appear in, enabling options (via ``+`` in a directive) is usually the only meaningful choice. However, option flags can also be passed to functions that run doctests, establishing different defaults. In such cases, disabling an option via ``-`` in a directive can be useful."
msgstr ""
msgid "Warnings"
msgstr ""
msgid ":mod:`!doctest` is serious about requiring exact matches in expected output. If even a single character doesn't match, the test fails. This will probably surprise you a few times, as you learn exactly what Python does and doesn't guarantee about output. For example, when printing a set, Python doesn't guarantee that the element is printed in any particular order, so a test like ::"
msgstr ""
msgid ""
">>> foo()\n"
"{\"spam\", \"eggs\"}"
msgstr ""
msgid "is vulnerable! One workaround is to do ::"
msgstr ""
msgid ""
">>> foo() == {\"spam\", \"eggs\"}\n"
"True"
msgstr ""
msgid "instead. Another is to do ::"
msgstr ""
msgid ""
">>> d = sorted(foo())\n"
">>> d\n"
"['eggs', 'spam']"
msgstr ""
msgid "There are others, but you get the idea."
msgstr ""
msgid "Another bad idea is to print things that embed an object address, like"
msgstr ""
msgid ""
">>> id(1.0) # certain to fail some of the time\n"
"7948648\n"
">>> class C: pass\n"
">>> C() # the default repr() for instances embeds an address\n"
"<C object at 0x00AC18F0>"
msgstr ""
msgid "The :const:`ELLIPSIS` directive gives a nice approach for the last example:"
msgstr ""
msgid ""
">>> C() # doctest: +ELLIPSIS\n"
"<C object at 0x...>"
msgstr ""
msgid "Floating-point numbers are also subject to small output variations across platforms, because Python defers to the platform C library for some floating-point calculations, and C libraries vary widely in quality here. ::"
msgstr ""
msgid ""
">>> 1000**0.1 # risky\n"
"1.9952623149688797\n"
">>> round(1000**0.1, 9) # safer\n"
"1.995262315\n"
">>> print(f'{1000**0.1:.4f}') # much safer\n"
"1.9953"
msgstr ""
msgid "Numbers of the form ``I/2.**J`` are safe across all platforms, and I often contrive doctest examples to produce numbers of that form::"
msgstr ""
msgid ""
">>> 3./4 # utterly safe\n"
"0.75"
msgstr ""
msgid "Simple fractions are also easier for people to understand, and that makes for better documentation."
msgstr ""
msgid "Basic API"
msgstr ""
msgid "The functions :func:`testmod` and :func:`testfile` provide a simple interface to doctest that should be sufficient for most basic uses. For a less formal introduction to these two functions, see sections :ref:`doctest-simple-testmod` and :ref:`doctest-simple-testfile`."
msgstr ""
msgid "All arguments except *filename* are optional, and should be specified in keyword form."
msgstr ""
msgid "Test examples in the file named *filename*. Return ``(failure_count, test_count)``."
msgstr ""
msgid "Optional argument *module_relative* specifies how the filename should be interpreted:"
msgstr ""
msgid "If *module_relative* is ``True`` (the default), then *filename* specifies an OS-independent module-relative path. By default, this path is relative to the calling module's directory; but if the *package* argument is specified, then it is relative to that package. To ensure OS-independence, *filename* should use ``/`` characters to separate path segments, and may not be an absolute path (i.e., it may not begin with ``/``)."
msgstr ""
msgid "If *module_relative* is ``False``, then *filename* specifies an OS-specific path. The path may be absolute or relative; relative paths are resolved with respect to the current working directory."
msgstr ""
msgid "Optional argument *name* gives the name of the test; by default, or if ``None``, ``os.path.basename(filename)`` is used."
msgstr ""
msgid "Optional argument *package* is a Python package or the name of a Python package whose directory should be used as the base directory for a module-relative filename. If no package is specified, then the calling module's directory is used as the base directory for module-relative filenames. It is an error to specify *package* if *module_relative* is ``False``."
msgstr ""
msgid "Optional argument *globs* gives a dict to be used as the globals when executing examples. A new shallow copy of this dict is created for the doctest, so its examples start with a clean slate. By default, or if ``None``, a new empty dict is used."
msgstr ""
msgid "Optional argument *extraglobs* gives a dict merged into the globals used to execute examples. This works like :meth:`dict.update`: if *globs* and *extraglobs* have a common key, the associated value in *extraglobs* appears in the combined dict. By default, or if ``None``, no extra globals are used. This is an advanced feature that allows parameterization of doctests. For example, a doctest can be written for a base class, using a generic name for the class, then reused to test any number of subclasses by passing an *extraglobs* dict mapping the generic name to the subclass to be tested."
msgstr ""
msgid "Optional argument *verbose* prints lots of stuff if true, and prints only failures if false; by default, or if ``None``, it's true if and only if ``'-v'`` is in :data:`sys.argv`."
msgstr ""
msgid "Optional argument *report* prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else the summary is very brief (in fact, empty if all tests passed)."
msgstr ""
msgid "Optional argument *optionflags* (default value ``0``) takes the :ref:`bitwise OR <bitwise>` of option flags. See section :ref:`doctest-options`."
msgstr ""
msgid "Optional argument *raise_on_error* defaults to false. If true, an exception is raised upon the first failure or unexpected exception in an example. This allows failures to be post-mortem debugged. Default behavior is to continue running examples."
msgstr ""
msgid "Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) that should be used to extract tests from the files. It defaults to a normal parser (i.e., ``DocTestParser()``)."
msgstr ""
msgid "Optional argument *encoding* specifies an encoding that should be used to convert the file to unicode."
msgstr ""
msgid "All arguments are optional, and all except for *m* should be specified in keyword form."
msgstr ""
msgid "Test examples in docstrings in functions and classes reachable from module *m* (or module :mod:`__main__` if *m* is not supplied or is ``None``), starting with ``m.__doc__``."
msgstr ""
msgid "Also test examples reachable from dict ``m.__test__``, if it exists. ``m.__test__`` maps names (strings) to functions, classes and strings; function and class docstrings are searched for examples; strings are searched directly, as if they were docstrings."
msgstr ""
msgid "Only docstrings attached to objects belonging to module *m* are searched."
msgstr ""
msgid "Return ``(failure_count, test_count)``."
msgstr ""
msgid "Optional argument *name* gives the name of the module; by default, or if ``None``, ``m.__name__`` is used."
msgstr ""
msgid "Optional argument *exclude_empty* defaults to false. If true, objects for which no doctests are found are excluded from consideration. The default is a backward compatibility hack, so that code still using :meth:`doctest.master.summarize <DocTestRunner.summarize>` in conjunction with :func:`testmod` continues to get output for objects with no tests. The *exclude_empty* argument to the newer :class:`DocTestFinder` constructor defaults to true."
msgstr ""
msgid "Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, *raise_on_error*, and *globs* are the same as for function :func:`testfile` above, except that *globs* defaults to ``m.__dict__``."
msgstr ""
msgid "Test examples associated with object *f*; for example, *f* may be a string, a module, a function, or a class object."
msgstr ""
msgid "A shallow copy of dictionary argument *globs* is used for the execution context."
msgstr ""
msgid "Optional argument *name* is used in failure messages, and defaults to ``\"NoName\"``."
msgstr ""
msgid "If optional argument *verbose* is true, output is generated even if there are no failures. By default, output is generated only in case of an example failure."
msgstr ""
msgid "Optional argument *compileflags* gives the set of flags that should be used by the Python compiler when running the examples. By default, or if ``None``, flags are deduced corresponding to the set of future features found in *globs*."
msgstr ""
msgid "Optional argument *optionflags* works as for function :func:`testfile` above."
msgstr ""
msgid "Unittest API"
msgstr ""
msgid "As your collection of doctest'ed modules grows, you'll want a way to run all their doctests systematically. :mod:`!doctest` provides two functions that can be used to create :mod:`unittest` test suites from modules and text files containing doctests. To integrate with :mod:`unittest` test discovery, include a :ref:`load_tests <load_tests-protocol>` function in your test module::"
msgstr ""
msgid ""
"import unittest\n"
"import doctest\n"
"import my_module_with_doctests\n"
"\n"
"def load_tests(loader, tests, ignore):\n"
" tests.addTests(doctest.DocTestSuite(my_module_with_doctests))\n"
" return tests"
msgstr ""
msgid "There are two main functions for creating :class:`unittest.TestSuite` instances from text files and modules with doctests:"
msgstr ""
msgid "Convert doctest tests from one or more text files to a :class:`unittest.TestSuite`."
msgstr ""
msgid "The returned :class:`unittest.TestSuite` is to be run by the unittest framework and runs the interactive examples in each file. If an example in any file fails, then the synthesized unit test fails, and a :exc:`~unittest.TestCase.failureException` exception is raised showing the name of the file containing the test and a (sometimes approximate) line number. If all the examples in a file are skipped, then the synthesized unit test is also marked as skipped."
msgstr ""
msgid "Pass one or more paths (as strings) to text files to be examined."
msgstr ""
msgid "Options may be provided as keyword arguments:"
msgstr ""
msgid "Optional argument *module_relative* specifies how the filenames in *paths* should be interpreted:"
msgstr ""
msgid "If *module_relative* is ``True`` (the default), then each filename in *paths* specifies an OS-independent module-relative path. By default, this path is relative to the calling module's directory; but if the *package* argument is specified, then it is relative to that package. To ensure OS-independence, each filename should use ``/`` characters to separate path segments, and may not be an absolute path (i.e., it may not begin with ``/``)."
msgstr ""
msgid "If *module_relative* is ``False``, then each filename in *paths* specifies an OS-specific path. The path may be absolute or relative; relative paths are resolved with respect to the current working directory."
msgstr ""
msgid "Optional argument *package* is a Python package or the name of a Python package whose directory should be used as the base directory for module-relative filenames in *paths*. If no package is specified, then the calling module's directory is used as the base directory for module-relative filenames. It is an error to specify *package* if *module_relative* is ``False``."
msgstr ""
msgid "Optional argument *setUp* specifies a set-up function for the test suite. This is called before running the tests in each file. The *setUp* function will be passed a :class:`DocTest` object. The *setUp* function can access the test globals as the :attr:`~DocTest.globs` attribute of the test passed."
msgstr ""
msgid "Optional argument *tearDown* specifies a tear-down function for the test suite. This is called after running the tests in each file. The *tearDown* function will be passed a :class:`DocTest` object. The *tearDown* function can access the test globals as the :attr:`~DocTest.globs` attribute of the test passed."
msgstr ""
msgid "Optional argument *globs* is a dictionary containing the initial global variables for the tests. A new copy of this dictionary is created for each test. By default, *globs* is a new empty dictionary."
msgstr ""
msgid "Optional argument *optionflags* specifies the default doctest options for the tests, created by or-ing together individual option flags. See section :ref:`doctest-options`. See function :func:`set_unittest_reportflags` below for a better way to set reporting options."
msgstr ""
msgid "The global ``__file__`` is added to the globals provided to doctests loaded from a text file using :func:`DocFileSuite`."
msgstr ""
msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`."
msgstr ""
msgid "The returned :class:`unittest.TestSuite` is to be run by the unittest framework and runs each doctest in the module. Each docstring is run as a separate unit test. If any of the doctests fail, then the synthesized unit test fails, and a :exc:`unittest.TestCase.failureException` exception is raised showing the name of the file containing the test and a (sometimes approximate) line number. If all the examples in a docstring are skipped, then the"
msgstr ""
msgid "Optional argument *module* provides the module to be tested. It can be a module object or a (possibly dotted) module name. If not specified, the module calling this function is used."
msgstr ""
msgid "Optional argument *globs* is a dictionary containing the initial global variables for the tests. A new copy of this dictionary is created for each test. By default, *globs* is the module's :attr:`~module.__dict__`."
msgstr ""
msgid "Optional argument *extraglobs* specifies an extra set of global variables, which is merged into *globs*. By default, no extra globals are used."
msgstr ""
msgid "Optional argument *test_finder* is the :class:`DocTestFinder` object (or a drop-in replacement) that is used to extract doctests from the module."
msgstr ""
msgid "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as for function :func:`DocFileSuite` above, but they are called for each docstring."
msgstr ""
msgid "This function uses the same search technique as :func:`testmod`."
msgstr ""
msgid ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if *module* contains no docstrings instead of raising :exc:`ValueError`."
msgstr ""
msgid "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` out of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` is a subclass of :class:`unittest.TestCase`. :class:`!DocTestCase` isn't documented here (it's an internal detail), but studying its code can answer questions about the exact details of :mod:`unittest` integration."
msgstr ""
msgid "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out of :class:`!doctest.DocFileCase` instances, and :class:`!DocFileCase` is a subclass of :class:`!DocTestCase`."
msgstr ""
msgid "So both ways of creating a :class:`unittest.TestSuite` run instances of :class:`!DocTestCase`. This is important for a subtle reason: when you run :mod:`!doctest` functions yourself, you can control the :mod:`!doctest` options in use directly, by passing option flags to :mod:`!doctest` functions. However, if you're writing a :mod:`unittest` framework, :mod:`!unittest` ultimately controls when and how tests get run. The framework author typically wants to control :mod:`!doctest` reporting options (perhaps, e.g., specified by command line options), but there's no way to pass options through :mod:`!unittest` to :mod:`!doctest` test runners."
msgstr ""
msgid "For this reason, :mod:`!doctest` also supports a notion of :mod:`!doctest` reporting flags specific to :mod:`unittest` support, via this function:"
msgstr ""
msgid "Set the :mod:`!doctest` reporting flags to use."
msgstr ""
msgid "Argument *flags* takes the :ref:`bitwise OR <bitwise>` of option flags. See section :ref:`doctest-options`. Only \"reporting flags\" can be used."
msgstr ""
msgid "This is a module-global setting, and affects all future doctests run by module :mod:`unittest`: the :meth:`!runTest` method of :class:`!DocTestCase` looks at the option flags specified for the test case when the :class:`!DocTestCase` instance was constructed. If no reporting flags were specified (which is the typical and expected case), :mod:`!doctest`'s :mod:`!unittest` reporting flags are :ref:`bitwise ORed <bitwise>` into the option flags, and the option flags so augmented are passed to the :class:`DocTestRunner` instance created to run the doctest. If any reporting flags were specified when the :class:`!DocTestCase` instance was constructed, :mod:`!doctest`'s :mod:`!unittest` reporting flags are ignored."
msgstr ""
msgid "The value of the :mod:`unittest` reporting flags in effect before the function was called is returned by the function."
msgstr ""
msgid "Advanced API"
msgstr ""
msgid "The basic API is a simple wrapper that's intended to make doctest easy to use. It is fairly flexible, and should meet most users' needs; however, if you require more fine-grained control over testing, or wish to extend doctest's capabilities, then you should use the advanced API."
msgstr ""
msgid "The advanced API revolves around two container classes, which are used to store the interactive examples extracted from doctest cases:"
msgstr ""
msgid ":class:`Example`: A single Python :term:`statement`, paired with its expected output."
msgstr ""
msgid ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted from a single docstring or text file."
msgstr ""
msgid "Additional processing classes are defined to find, parse, and run, and check doctest examples:"
msgstr ""
msgid ":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :class:`DocTestParser` to create a :class:`DocTest` from every docstring that contains interactive examples."
msgstr ""
msgid ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string (such as an object's docstring)."
msgstr ""
msgid ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and uses an :class:`OutputChecker` to verify their output."
msgstr ""
msgid ":class:`OutputChecker`: Compares the actual output from a doctest example with the expected output, and decides whether they match."
msgstr ""
msgid "The relationships among these processing classes are summarized in the following diagram::"
msgstr ""
msgid ""
" list of:\n"
"+------+ +---------+\n"
"|module| --DocTestFinder-> | DocTest | --DocTestRunner-> results\n"
"+------+ | ^ +---------+ | ^ (printed)\n"
" | | | Example | | |\n"
" v | | ... | v |\n"
" DocTestParser | Example | OutputChecker\n"
" +---------+"
msgstr ""
msgid "DocTest Objects"
msgstr ""
msgid "A collection of doctest examples that should be run in a single namespace. The constructor arguments are used to initialize the attributes of the same names."
msgstr ""
msgid ":class:`DocTest` defines the following attributes. They are initialized by the constructor, and should not be modified directly."
msgstr ""
msgid "A list of :class:`Example` objects encoding the individual interactive Python examples that should be run by this test."
msgstr ""
msgid "The namespace (aka globals) that the examples should be run in. This is a dictionary mapping names to values. Any changes to the namespace made by the examples (such as binding new variables) will be reflected in :attr:`globs` after the test is run."
msgstr ""
msgid "A string name identifying the :class:`DocTest`. Typically, this is the name of the object or file that the test was extracted from."
msgstr ""
msgid "The name of the file that this :class:`DocTest` was extracted from; or ``None`` if the filename is unknown, or if the :class:`!DocTest` was not extracted from a file."
msgstr ""
msgid "The line number within :attr:`filename` where this :class:`DocTest` begins, or ``None`` if the line number is unavailable. This line number is zero-based with respect to the beginning of the file."
msgstr ""
msgid "The string that the test was extracted from, or ``None`` if the string is unavailable, or if the test was not extracted from a string."
msgstr ""
msgid "Example Objects"
msgstr ""