All Samples(25) | Call(22) | Derive(0) | Import(3)
Test examples in the given object's docstring (`f`), using `globs` as globals. Optional argument `name` is used in failure messages. If the optional argument `verbose` is true, then generate output even if there are no failures. `compileflags` gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to `globs`. Optional keyword arg `optionflags` specifies options for the testing and output. See the documentation for `testmod` for more information.
def run_docstring_examples(f, globs, verbose=False, name="NoName",
compileflags=None, optionflags=0):
"""
Test examples in the given object's docstring (`f`), using `globs`
as globals. Optional argument `name` is used in failure messages.
If the optional argument `verbose` is true, then generate output
even if there are no failures.
`compileflags` gives the set of flags that should be used by the
Python compiler when running the examples. If not specified, then
it will default to the set of future-import flags that apply to
`globs`.
Optional keyword arg `optionflags` specifies options for the
testing and output. See the documentation for `testmod` for more
information.
"""
# Find, parse, and run all tests in the given module.
finder = DocTestFinder(verbose=verbose, recurse=False)
runner = DocTestRunner(verbose=verbose, optionflags=optionflags)
for test in finder.find(f, name, globs=globs):
runner.run(test, compileflags=compileflags)
globs = env(a, c=c, f=f, import_models=import_models)
execfile(testfile, globs)
doctest.run_docstring_examples(obj, globs=globs,
name='%s: %s' % (os.path.basename(testfile),
name), verbose=verbose)
if type(obj) in (types.TypeType, types.ClassType):
src/n/e/netcidr-HEAD/trunk/netcidr/__init__.py netcidr(Download)
if len(sys.argv) > 1:
possibleObject = sys.argv[-1]
if possibleObject.split('.')[0] in globals().keys():
return doctest.run_docstring_examples(eval(possibleObject),
globals(), name=possibleObject)
return doctest.testmod()
src/n/e/netcidr-HEAD/trunk/netcidr/utils.py netcidr(Download)
if len(sys.argv) > 1:
possibleObject = sys.argv[-1]
if possibleObject.split('.')[0] in globals().keys():
return doctest.run_docstring_examples(eval(possibleObject),
globals(), name=possibleObject)
return doctest.testmod()
src/n/e/netcidr-HEAD/netcidr/__init__.py netcidr(Download)
if len(sys.argv) > 1:
possibleObject = sys.argv[-1]
if possibleObject.split('.')[0] in globals().keys():
return doctest.run_docstring_examples(eval(possibleObject),
globals(), name=possibleObject)
return doctest.testmod()
src/n/e/netcidr-HEAD/netcidr/utils.py netcidr(Download)
if len(sys.argv) > 1:
possibleObject = sys.argv[-1]
if possibleObject.split('.')[0] in globals().keys():
return doctest.run_docstring_examples(eval(possibleObject),
globals(), name=possibleObject)
return doctest.testmod()
src/n/e/NetCIDR-0.0.4/netcidr/__init__.py NetCIDR(Download)
if len(sys.argv) > 1:
possibleObject = sys.argv[-1]
if possibleObject.split('.')[0] in globals().keys():
return doctest.run_docstring_examples(eval(possibleObject),
globals(), name=possibleObject)
return doctest.testmod()
src/n/e/NetCIDR-0.0.4/netcidr/utils.py NetCIDR(Download)
if len(sys.argv) > 1:
possibleObject = sys.argv[-1]
if possibleObject.split('.')[0] in globals().keys():
return doctest.run_docstring_examples(eval(possibleObject),
globals(), name=possibleObject)
return doctest.testmod()
src/n/e/NetCIDR-0.0.4/netcidr/networks.py NetCIDR(Download)
if len(sys.argv) > 1:
possibleObject = sys.argv[-1]
if possibleObject.split('.')[0] in globals().keys():
return doctest.run_docstring_examples(eval(possibleObject),
globals(), name=possibleObject)
return doctest.testmod()
src/n/e/NetCIDR-0.0.4/netcidr/blocks.py NetCIDR(Download)
if len(sys.argv) > 1:
possibleObject = sys.argv[-1]
if possibleObject.split('.')[0] in globals().keys():
return doctest.run_docstring_examples(eval(possibleObject),
globals(), name=possibleObject)
return doctest.testmod()
src/s/y/sympy-tensor-HEAD/sympy/mpmath/__init__.py sympy-tensor(Download)
continue
print obj,
t1 = clock()
doctest.run_docstring_examples(globs[obj], {}, verbose=("-v" in sys.argv))
t2 = clock()
print round(t2-t1, 3)
1 | 2 | 3 Next