Home | History | Annotate | Download | only in python2.7

Lines Matching refs:globs

178 def _extract_future_flags(globs):
181 have been imported into the given namespace (globs).
185 feature = globs.get(fname, None)
480 - globs: The namespace (aka globals) that the examples should
497 def __init__(self, examples, globs, name, filename, lineno, docstring):
500 DocTest's globals are initialized with a copy of `globs`.
506 self.globs = globs.copy()
527 self.globs == other.globs and \
636 def get_doctest(self, string, globs, name, filename, lineno):
641 `globs`, `name`, `filename`, and `lineno` are attributes for
645 return DocTest(self.get_examples(string, name), globs,
815 def find(self, obj, name=None, module=None, globs=None, extraglobs=None):
826 - As a default namespace, if `globs` is not specified.
841 The globals for each DocTest is formed by combining `globs`
843 in `globs`). A new copy of the globals dictionary is created
844 for each DocTest. If `globs` is not specified, then it
886 if globs is None:
888 globs = {}
890 globs = module.__dict__.copy()
892 globs = globs.copy()
894 globs.update(extraglobs)
895 if '__name__' not in globs:
896 globs['__name__'] = '__main__' # provide a default module name
900 self._find(tests, obj, name, module, source_lines, globs, {})
928 def _find(self, tests, obj, name, module, source_lines, globs, seen):
942 test = self._get_test(obj, name, module, globs, source_lines)
954 globs, seen)
972 globs, seen)
989 globs, seen)
991 def _get_test(self, obj, name, module, globs, source_lines):
1025 return self._parser.get_doctest(docstring, globs, name,
1239 in the namespace `test.globs`.
1283 # Run the example in the given context (globs), and record
1289 compileflags, 1) in test.globs
1384 The examples are run in the namespace `test.globs`. If
1393 flags that apply to `globs`.
1402 compileflags = _extract_future_flags(test.globs)
1436 test.globs.clear()
1741 >>> del test.globs['__builtins__']
1742 >>> test.globs
1755 >>> del test.globs['__builtins__']
1756 >>> test.globs
1768 >>> test.globs
1776 test.globs.clear()
1794 def testmod(m=None, name=None, globs=None, verbose=None,
1797 """m=None, name=None, globs=None, verbose=None, report=True,
1817 Optional keyword arg "globs" gives a dict to be used as the globals
1885 for test in finder.find(m, name, globs=globs, extraglobs=extraglobs):
1899 globs=None, verbose=None, report=True, optionflags=0,
1930 Optional keyword arg "globs" gives a dict to be used as the globals
1992 if globs is None:
1993 globs = {}
1995 globs = globs.copy()
1997 globs.update(extraglobs)
1998 if '__name__' not in globs:
1999 globs['__name__'] = '__main__'
2010 test = parser.get_doctest(text, globs, name, filename, 0)
2023 def run_docstring_examples(f, globs, verbose=False, name="NoName",
2026 Test examples in the given object's docstring (`f`), using `globs`
2034 `globs`.
2043 for test in finder.find(f, name, globs=globs):
2053 def __init__(self, mod=None, globs=None, verbose=None, optionflags=0):
2058 if mod is None and globs is None:
2059 raise TypeError("Tester.__init__: must specify mod or globs")
2063 if globs is None:
2064 globs = mod.__dict__
2065 self.globs = globs
2074 test = DocTestParser().get_doctest(s, self.globs, name, None, None)
2085 globs=self.globs)
2177 test.globs.clear()
2333 def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
2355 globs attribute of the test passed.
2361 globs attribute of the test passed.
2363 globs
2374 tests = test_finder.find(module, globs=globs, extraglobs=extraglobs)
2421 globs=None, parser=DocTestParser(),
2423 if globs is None:
2424 globs = {}
2426 globs = globs.copy()
2435 if "__file__" not in globs:
2436 globs["__file__"] = path
2446 test = parser.get_doctest(doc, globs, name, path, 0)
2484 globs attribute of the test passed.
2490 globs attribute of the test passed.
2492 globs
2620 def debug_src(src, pm=False, globs=None):
2623 debug_script(testsrc, pm, globs)
2625 def debug_script(src, pm=False, globs=None):
2638 if globs:
2639 globs = globs.copy()
2641 globs = {}
2645 execfile(srcfilename, globs, globs)
2652 pdb.run("execfile(%r)" % srcfilename, globs, globs)