Lines Matching refs:string
162 # Special string markers for use in `want` strings:
199 - If `module` is a string, then import and return the
212 raise TypeError("Expected a module, string, or None")
246 Return a string containing a traceback message for the given
312 # Search for an empty string succeeds, and doesn't change startpos.
434 ## a string (such as an object's docstring). The DocTest class also
435 ## includes information about where the string was extracted from.
448 string. The constructor adds a newline if needed.
458 - lineno: The line number within the DocTest string containing
462 - indent: The example's indentation in the DocTest string.
526 - docstring: The string that the examples were extracted from,
527 or `None` if the string is unavailable.
585 # string. It defines three groups: `source` is the source code
628 def parse(self, string, name='<string>'):
630 Divide the given string into examples and intervening text,
633 argument `name` is a name identifying this string, and is only
636 string = string.expandtabs()
638 min_indent = self._min_indent(string)
640 string = '\n'.join([l[min_indent:] for l in string.split('\n')])
644 # Find all doctest examples in the string:
645 for m in self._EXAMPLE_RE.finditer(string):
647 output.append(string[charno:m.start()])
649 lineno += string.count('\n', charno, m.start())
660 lineno += string.count('\n', m.start(), m.end())
664 output.append(string[charno:])
667 def get_doctest(self, string, globs, name, filename, lineno):
669 Extract all doctest examples from the given string, and
676 return DocTest(self.get_examples(string, name), globs,
677 name, filename, lineno, string)
679 def get_examples(self, string, name='<string>'):
681 Extract all doctest examples from the given string, and return
688 string, and is only used for error messages.
690 return [x for x in self.parse(string, name)
701 `name` is the string's name, and `lineno` is the line number
740 # positives for string-literals that contain the string
742 # actually parsing the string; but we limit them by ignoring any
750 option directives in the given source string.
752 `name` is the string's name, and `lineno` is the line number
774 # line in a string.
787 Given the lines of a source string (including prompts and
1199 # This divider string is used to separate failure messages, and to
1589 returns a string describing the differences between two outputs.
1593 Convert string to hex-escaped ASCII string.
1609 # then `want` is a string of six characters(e.g. [\,u,1,2,3,4]).
1612 # be folded to hex-escaped ASCII string to compare.
1617 # if they're string-identical, always return true.
1685 Return a string describing the differences between the
1692 # with <BLANKLINE> in the actual output string.
2362 This converts each documentation string in a module that
2364 tests in a doc string fail, then the test case fails. An exception
2463 The path to each doctest file is given as a string; the
2464 interpretation of that string depends on the keyword argument
2620 with the doc string with tests to be debugged.
2637 "Debug a test script. `src` is the script, as a string."
2715 "string": r"""
2716 Example of a string object, searched as-is.