Home
last modified time | relevance | path

Searched full:doctest (Results 1 – 25 of 355) sorted by relevance

12345678910>>...15

/third_party/python/Lib/test/
Dtest_doctest.py2 Test script for doctest.
8 import doctest
201 >>> example = doctest.Example('print(1)', '1\n')
211 >>> example = doctest.Example('[].pop()', '', exc_msg,
213 ... options={doctest.ELLIPSIS: True})
221 >>> e = doctest.Example('print(1)', '1\n')
225 >>> e = doctest.Example('print(1)\n', '1\n')
230 >>> e = doctest.Example('print(1);\nprint(2)\n', '1\n2\n')
234 >>> e = doctest.Example('print(1);\nprint(2)', '1\n2\n')
239 >>> e = doctest.Example('', '')
[all …]
Dtest_pdb.py3 import doctest
18 # This little helper class is essential for testing pdb under doctest.
54 > <doctest test.test_pdb.test_pdb_displayhook[0]>(3)test_function()
96 >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE
121 > <doctest test.test_pdb.test_pdb_basic_commands[3]>(3)test_function()
125 > <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
144 <doctest test.test_pdb.test_pdb_basic_commands[4]>(25)<module>()
146 <doctest test.test_pdb.test_pdb_basic_commands[3]>(3)test_function()
148 > <doctest test.test_pdb.test_pdb_basic_commands[0]>(1)test_function_2()
151 > <doctest test.test_pdb.test_pdb_basic_commands[3]>(3)test_function()
[all …]
Dtest_zipimport_support.py12 import doctest
25 # doctest (Issue 4197)
37 finder = doctest.DocTestFinder(verbose=verbose, recurse=False)
38 runner = doctest.DocTestRunner(verbose=verbose)
51 print ('doctest (%s) ... %d tests with zero failures' % (module.__name__, t))
96 # To avoid having to keep two copies of the doctest module's
109 # The sample doctest files rewritten to include in the zipped version.
138 # which aren't available to the zipped version (the doctest
142 # doctest could really use some APIs which take a text
192 import doctest
[all …]
Dsample_doctest_no_doctests.py1 """This is a sample module used for testing doctest.
3 This module is for testing how doctest handles a module with docstrings
4 but no doctest examples.
10 """A docstring with no doctest examples.
Dtest_unpack_ex.py3 import doctest
318 >>> a, *b, c, *d, e = range(10) # doctest:+ELLIPSIS
323 >>> [*b, *c] = range(10) # doctest:+ELLIPSIS
328 >>> a,*b,*c,*d = range(4) # doctest:+ELLIPSIS
333 >>> *a = range(10) # doctest:+ELLIPSIS
338 >>> *a # doctest:+ELLIPSIS
343 >>> *1 # doctest:+ELLIPSIS
348 >>> x = *a # doctest:+ELLIPSIS
353 >>> (*x),y = 1, 2 # doctest:+ELLIPSIS
358 >>> (((*x))),y = 1, 2 # doctest:+ELLIPSIS
[all …]
/third_party/python/Doc/library/
Ddoctest.rst1 :mod:`doctest` --- Test interactive Python examples
4 .. module:: doctest
12 **Source code:** :source:`Lib/doctest.py`
16 The :mod:`doctest` module searches for pieces of text that look like interactive
18 exactly as shown. There are several common ways to use doctest:
85 import doctest
86 doctest.testmod()
88 If you run :file:`example.py` directly from the command line, :mod:`doctest`
97 ``-v`` to the script, and :mod:`doctest` prints a detailed log of what
133 That's all you need to know to start making productive use of :mod:`doctest`!
[all …]
Dimportlib.metadata.rst85 >>> from importlib.metadata import version # doctest: +SKIP
86 >>> version('wheel') # doctest: +SKIP
95 >>> list(metadata('wheel')) # doctest: +SKIP
123 >>> eps = entry_points() # doctest: +SKIP
129 >>> sorted(eps.groups) # doctest: +SKIP
136 >>> scripts = eps.select(group='console_scripts') # doctest: +SKIP
141 >>> scripts = entry_points(group='console_scripts') # doctest: +SKIP
145 >>> 'wheel' in scripts.names # doctest: +SKIP
147 >>> wheel = scripts['wheel'] # doctest: +SKIP
151 >>> (wheel,) = entry_points(group='console_scripts', name='wheel') # doctest: +SKIP
[all …]
Dtraceback.rst498 File "<doctest...>", line 10, in <module>
502 File "<doctest...>", line 10, in <module>
504 File "<doctest...>", line 4, in lumberjack
509 File "<doctest...>", line 10, in <module>
511 File "<doctest...>", line 4, in lumberjack
519 ' File "<doctest default[0]>", line 10, in <module>\n lumberjack()\n',
520 ' File "<doctest default[0]>", line 4, in lumberjack\n bright_side_of_life()\n',
521 …' File "<doctest default[0]>", line 7, in bright_side_of_life\n return tuple()[0]\n …
524 [<FrameSummary file <doctest...>, line 10 in <module>>,
525 <FrameSummary file <doctest...>, line 4 in lumberjack>,
[all …]
Dstatistics.rst17 __name__ = '<doctest>'
131 .. doctest::
169 .. doctest::
178 .. doctest::
209 .. doctest::
235 .. doctest::
244 .. doctest::
271 .. doctest::
279 .. doctest::
300 .. doctest::
[all …]
Dturtle.rst252 .. doctest::
274 .. doctest::
279 .. doctest::
298 .. doctest::
304 .. doctest::
323 .. doctest::
329 .. doctest::
352 .. doctest::
358 .. doctest::
382 .. doctest::
[all …]
/third_party/rust/rust/tests/rustdoc-ui/doctest/
Dfailed-doctest-output-windows.stdout3 test $DIR/failed-doctest-output-windows.rs - OtherStruct (line 25) ... FAILED
4 test $DIR/failed-doctest-output-windows.rs - SomeStruct (line 15) ... FAILED
8 ---- $DIR/failed-doctest-output-windows.rs - OtherStruct (line 25) stdout ----
10 --> $DIR/failed-doctest-output-windows.rs:26:1
19 ---- $DIR/failed-doctest-output-windows.rs - SomeStruct (line 15) stdout ----
29 thread 'main' panicked at 'oh no', $DIR/failed-doctest-output-windows.rs:7:1
35 $DIR/failed-doctest-output-windows.rs - OtherStruct (line 25)
36 $DIR/failed-doctest-output-windows.rs - SomeStruct (line 15)
Dfailed-doctest-output.stdout3 test $DIR/failed-doctest-output.rs - OtherStruct (line 25) ... FAILED
4 test $DIR/failed-doctest-output.rs - SomeStruct (line 15) ... FAILED
8 ---- $DIR/failed-doctest-output.rs - OtherStruct (line 25) stdout ----
10 --> $DIR/failed-doctest-output.rs:26:1
19 ---- $DIR/failed-doctest-output.rs - SomeStruct (line 15) stdout ----
29 thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:7:1
35 $DIR/failed-doctest-output.rs - OtherStruct (line 25)
36 $DIR/failed-doctest-output.rs - SomeStruct (line 15)
Dcfg-test.rs3 // normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
9 /// this doctest will be ignored:
17 /// this doctest will be tested:
25 /// this doctest will be tested, but will not appear in documentation:
30 #[cfg(doctest)]
Ddoc-test-doctest-feature.rs3 // normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
6 // Make sure `cfg(doctest)` is set when finding doctests but not inside
10 /// assert!(!cfg!(doctest));
12 #[cfg(doctest)]
Dfailed-doctest-extra-semicolon-on-item.stdout3 test $DIR/failed-doctest-extra-semicolon-on-item.rs - m (line 11) ... FAILED
7 ---- $DIR/failed-doctest-extra-semicolon-on-item.rs - m (line 11) stdout ----
9 --> $DIR/failed-doctest-extra-semicolon-on-item.rs:12:12
21 $DIR/failed-doctest-extra-semicolon-on-item.rs - m (line 11)
Dfailed-doctest-missing-codes.stdout3 test $DIR/failed-doctest-missing-codes.rs - Foo (line 9) - compile fail ... FAILED
7 ---- $DIR/failed-doctest-missing-codes.rs - Foo (line 9) stdout ----
9 --> $DIR/failed-doctest-missing-codes.rs:10:13
22 $DIR/failed-doctest-missing-codes.rs - Foo (line 9)
Drun-directory.rs1 // this test asserts that the cwd of doctest invocations is set correctly.
7 // normalize-stdout-test: "tests/rustdoc-ui/doctest" -> "$$DIR"
12 /// std::fs::read_to_string("doctest/run-directory.rs").unwrap(),
20 /// assert!(std::fs::read_to_string("doctest/run-directory.rs").is_err());
/third_party/python/Lib/
Ddoctest.py1 # Module doctest.
9 r"""Module doctest -- a framework for running examples in docstrings.
14 import doctest
15 doctest.testmod()
44 of doctest's default behaviors. See the Library Reference Manual for
67 # 2. Example & DocTest
69 'DocTest',
70 # 3. Doctest Parser
72 # 4. Doctest Finder
74 # 5. Doctest Runner
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/ide/src/
Drunnables.rs51 DocTest { test_id: TestId }, enumerator
60 DocTest, enumerator
72 RunnableKind::DocTest { test_id, .. } => format!("doctest {test_id}"), in label()
90 RunnableKind::DocTest { .. } => "Doctest", in title()
103 RunnableKind::DocTest { .. } => RunnableTestKind::DocTest, in test_kind()
388 Some(Runnable { use_name_in_title: false, nav, kind: RunnableKind::DocTest { test_id }, cfg }) in runnable_impl()
478 kind: RunnableKind::DocTest { test_id }, in module_def_doctest()
801 &[Bin, DocTest, DocTest, DocTest, DocTest, DocTest, DocTest, DocTest, DocTest], in test_runnables_doc_test()
827 kind: DocTest { in test_runnables_doc_test()
843 kind: DocTest { in test_runnables_doc_test()
[all …]
/third_party/json/tests/thirdparty/doctest/
Ddoctest_compatibility.h5 …_LOCAL // enable single-threaded builds on XCode 6/7 - https://github.com/onqtam/doctest/issues/172
6 #include "doctest.h"
8 // Catch doesn't require a semicolon after CAPTURE but doctest does
12 // Sections from Catch are called Subcases in doctest and don't work with std::string by default
20 // doctest doesn't support THROWS_WITH for std::string out of the box (has to include <string>...)
35 using doctest::Approx;
/third_party/rust/rust/src/tools/clippy/tests/ui/
Dneedless_doc_main.stderr1 error: needless `fn main` in doctest
7 = note: `-D clippy::needless-doctest-main` implied by `-D warnings`
9 error: needless `fn main` in doctest
15 error: needless `fn main` in doctest
21 error: needless `fn main` in doctest
/third_party/python/Doc/howto/
Dsorting.rst23 .. doctest::
33 .. doctest::
43 .. doctest::
57 .. doctest::
70 .. doctest::
82 .. doctest::
110 .. doctest::
123 .. doctest::
138 .. doctest::
153 .. doctest::
[all …]
/third_party/rust/rust/src/tools/rust-analyzer/crates/project-model/test_data/
Dregex-metadata.json37 "doctest": true, boolean
120 "doctest": true, boolean
134 "doctest": false, boolean
148 "doctest": false, boolean
162 "doctest": false, boolean
176 "doctest": false, boolean
190 "doctest": false, boolean
269 "doctest": true, boolean
283 "doctest": false, boolean
362 "doctest": true, boolean
[all …]
Dripgrep-metadata.json37 "doctest": true, boolean
132 "doctest": true, boolean
250 "doctest": true, boolean
264 "doctest": false, boolean
374 "doctest": true, boolean
388 "doctest": false, boolean
402 "doctest": false, boolean
416 "doctest": false, boolean
430 "doctest": false, boolean
585 "doctest": true, boolean
[all …]
/third_party/jerryscript/tools/
Dgen-doctest.py35 :param dry: if True, don't create the doctest files but print the file
57 Process a doctest declaration (`[doctest]: # (name="test.c", ...)`).
87 :return: a tuple of a list (of the first line(s) of the doctest) and the
97 :param code: the list of lines of the doctest.
123 decl_match = re.match(r'^\[doctest\]:\s+#\s+\((.*)\)\s*$', line)
156 parser = argparse.ArgumentParser(description='Markdown doctest extractor', epilog="""
160 `[doctest]: # (name="test.c", ...)`. For now, two parameters are valid:

12345678910>>...15