• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(1252)  |  Call(1175)  |  Derive(0)  |  Import(77)
A unittest suite for one or more doctest files.

The path to each doctest file is given as a string; the
interpretation of that string depends on the keyword argument
"module_relative".

A number of options may be provided as keyword arguments:

module_relative
  If "module_relative" is True, then the given file paths are
  interpreted as os-independent module-relative paths.  By
  default, these paths are relative to the calling module's
  directory; but if the "package" argument is specified, then
  they are 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 "/").

  If "module_relative" is False, then the given file paths are
  interpreted as os-specific paths.  These paths may be absolute
  or relative (to the current working directory).

package
  A Python package or the name of a Python package whose directory
  should be used as the base directory for module relative paths.
  If "package" is not 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.

setUp
  A set-up function.  This is called before running the
  tests in each file. The setUp function will be passed a DocTest
  object.  The setUp function can access the test globals as the
  globs attribute of the test passed.

tearDown
  A tear-down function.  This is called after running the
  tests in each file.  The tearDown function will be passed a DocTest
  object.  The tearDown function can access the test globals as the
  globs attribute of the test passed.

globs
  A dictionary containing initial global variables for the tests.

optionflags
  A set of doctest option flags expressed as an integer.

parser
  A DocTestParser (or subclass) that should be used to extract
  tests from the files.

encoding
  An encoding that will be used to convert the files to unicode.

        def DocFileSuite(*paths, **kw):
    """A unittest suite for one or more doctest files.

    The path to each doctest file is given as a string; the
    interpretation of that string depends on the keyword argument
    "module_relative".

    A number of options may be provided as keyword arguments:

    module_relative
      If "module_relative" is True, then the given file paths are
      interpreted as os-independent module-relative paths.  By
      default, these paths are relative to the calling module's
      directory; but if the "package" argument is specified, then
      they are 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 "/").

      If "module_relative" is False, then the given file paths are
      interpreted as os-specific paths.  These paths may be absolute
      or relative (to the current working directory).

    package
      A Python package or the name of a Python package whose directory
      should be used as the base directory for module relative paths.
      If "package" is not 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.

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
      A set of doctest option flags expressed as an integer.

    parser
      A DocTestParser (or subclass) that should be used to extract
      tests from the files.

    encoding
      An encoding that will be used to convert the files to unicode.
    """
    suite = unittest.TestSuite()

    # We do this here so that _normalize_module is called at the right
    # level.  If it were called in DocFileTest, then this function
    # would be the caller and we might guess the package incorrectly.
    if kw.get('module_relative', True):
        kw['package'] = _normalize_module(kw.get('package'))

    for path in paths:
        suite.addTest(DocFileTest(path, **kw))

    return suite
        


src/z/3/z3c.sampledata-0.4.0/src/z3c/sampledata/tests.py   z3c.sampledata(Download)
def test_suite():
 
    return unittest.TestSuite((
        doctest.DocFileSuite(
                'README.txt',
                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
                ),
        doctest.DocFileSuite(
                'generator/site.txt',
                setUp=setUp, tearDown=tearDown,
                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
                ),
        doctest.DocFileSuite(
                'generator/intids.txt',
                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
                ),
        doctest.DocFileSuite(
                'generator/pau.txt',
                setUp=setUp, tearDown=tearDown,
                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
                ),
        doctest.DocFileSuite(
                'generator/principals.txt',

src/s/h/should_dsl-2.0a4/run_all_examples.py   should_dsl(Download)
def test_suite():
    flags = doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS
    if sys.version_info >= (3,):
        flags |= doctest.IGNORE_EXCEPTION_DETAIL
    doctests_path = os.path.join('should_dsl', 'doctests')
    suite = unittest.TestSuite()
    suite.addTest(doctest.DocFileSuite('README.rst', optionflags=flags))
    for doctest_file in os.listdir(doctests_path):
        if doctest_file.endswith('.txt'):
            suite.addTest(doctest.DocFileSuite(os.path.join(doctests_path,

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/testrunner-ex/sample2/sampletests/test_1.py   zope.testrunner(Download)
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestA))
    suite.addTest(unittest.makeSuite(TestB))
    suite.addTest(unittest.makeSuite(TestNotMuch))
    suite.addTest(doctest.DocTestSuite(setUp=setUp))
    suite.addTest(doctest.DocFileSuite('../../sampletests.txt',

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/testrunner-ex/sample2/sampletests/testone.py   zope.testrunner(Download)
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestA))
    suite.addTest(unittest.makeSuite(TestB))
    suite.addTest(unittest.makeSuite(TestNotMuch))
    suite.addTest(doctest.DocTestSuite(setUp=setUp))
    suite.addTest(doctest.DocFileSuite('../../sampletests.txt',

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/testrunner-ex/sample2/sample21/sampletests.py   zope.testrunner(Download)
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestA))
    suite.addTest(unittest.makeSuite(TestB))
    suite.addTest(unittest.makeSuite(TestNotMuch))
    suite.addTest(doctest.DocTestSuite(setUp=setUp))
    suite.addTest(doctest.DocFileSuite('../../sampletests.txt',

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/testrunner-ex/sample1/sampletests/test_one.py   zope.testrunner(Download)
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TestA))
    suite.addTest(unittest.makeSuite(TestB))
    suite.addTest(unittest.makeSuite(TestNotMuch))
    suite.addTest(doctest.DocTestSuite(setUp=setUp))
    suite.addTest(doctest.DocFileSuite('../../sampletests.txt',

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/testrunner-ex/sample1/sampletests/test122.py   zope.testrunner(Download)
    s = doctest.DocTestSuite(setUp=setUp)
    s.layer = layer
    suite.addTest(s)
    s = doctest.DocFileSuite('../../sampletestsl.txt', setUp=setUp)
    s.layer = layer
    suite.addTest(s)
    return suite

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/testrunner-ex/sample1/sampletests/test121.py   zope.testrunner(Download)
    s = doctest.DocTestSuite(setUp=setUp)
    s.layer = layer
    suite.addTest(s)
    s = doctest.DocFileSuite('../../sampletestsl.txt', setUp=setUp)
    s.layer = layer
    suite.addTest(s)
    return suite

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/testrunner-ex/sample1/sampletests/test12.py   zope.testrunner(Download)
    s = doctest.DocTestSuite(setUp=setUp)
    s.layer = layer
    suite.addTest(s)
    s = doctest.DocFileSuite('../../sampletestsl.txt', setUp=setUp)
    s.layer = layer
    suite.addTest(s)
    return suite

src/z/o/zope.testrunner-4.0.0b5/src/zope/testrunner/testrunner-ex/sample1/sampletests/test112.py   zope.testrunner(Download)
    s = doctest.DocTestSuite(setUp=setUp)
    s.layer = layer
    suite.addTest(s)
    s = doctest.DocFileSuite('../../sampletestsl.txt', setUp=setUp)
    s.layer = layer
    suite.addTest(s)
    return suite

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next