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
""" __docformat__ = "reStructuredText" from doctest import DocFileSuite import doctest import itertools import unittest
setups = (testing.setUpZPT, )
tests = ((
DocFileSuite('README.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('button.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('checkbox.txt',
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('file.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('file-testing.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('image.txt',
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('orderedselect.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('password.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('radio.txt',
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('select.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('select-source.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('submit.txt',
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('text.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('textarea.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('textlines.txt',
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('object.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('objectmulti.txt',
setUp=setUp, tearDown=testing.tearDown,
optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
checker=checker,
),
DocFileSuite('multi.txt',
src/i/n/infrae.subversion-1.4.5/infrae/subversion/tests/test_impl.py infrae.subversion(Download)
import os.path import sys import unittest from doctest import DocFileSuite import py import svnhelper.testing
def test_suite():
tests = [DocFileSuite(test_file('IMPL.txt'),
optionflags=flags,
globs=globals(),
setUp=setUp,
tearDown=tearDown,
module_relative=False)]
if have_pysvn():
tests += [DocFileSuite(test_file('EXPORT.txt'),
src/g/e/getpaid.luottokunta-0.4.1/getpaid/luottokunta/tests/test_doctests.py getpaid.luottokunta(Download)
import unittest import doctest #from zope.testing import doctestunit from doctest import DocFileSuite from zope.component import testing from Testing import ZopeTestCase as ztc
def test_suite():
return unittest.TestSuite([
# Unit tests for adapters.
DocFileSuite(
'tests/unittests/adapters_unittests.txt', package='getpaid.luottokunta',
setUp=testing.setUp, tearDown=testing.tearDown,
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE | doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
# Unit tests for utilities.
DocFileSuite(
'tests/unittests/utilities_unittests.txt', package='getpaid.luottokunta',
src/c/u/currency.converter-0.5.5/currency/converter/tests/test_doctest.py currency.converter(Download)
import os import unittest import doctest from doctest import DocFileSuite from zope.component import testing from Testing import ZopeTestCase as ztc from Products.CMFCore.utils import getToolByName
# Unit tests
DocFileSuite(
'tests/unittest.txt', package='currency.converter',
setUp=testing.setUp, tearDown=testing.tearDown,
optionflags=doctest.REPORT_ONLY_FIRST_FAILURE | doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
src/c/o/collective.anonymousbrowser-0.11/src/collective/anonymousbrowser/tests/test_doctest_files.py collective.anonymousbrowser(Download)
import unittest import doctest from doctest import DocFileSuite from collective.anonymousbrowser.tests.utils import launch_servers, stop_servers flags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE | doctest.REPORT_ONLY_FIRST_FAILURE)
suite = unittest.TestSuite()
for test in tests:
suite.addTest(DocFileSuite(
test,
setUp = launch_servers,
tearDown = stop_servers,
globs = {
src/e/r/errorhandler-1.1.1/errorhandler/tests.py errorhandler(Download)
import logging from os.path import dirname,join,pardir import unittest from doctest import DocFileSuite,DocTestSuite,REPORT_NDIFF,ELLIPSIS from errorhandler import ErrorHandler class TestErrorHandler:
def test_suite():
return unittest.TestSuite((
DocFileSuite(
module_relative=False,
setUp=setUp,
tearDown=tearDown,
optionflags=options,
src/y/o/yoma-HEAD/yoma.nsobject/trunk/src/yoma/nsobject/tests.py yoma(Download)
import objc
from unittest import TestSuite, main
from doctest import DocFileSuite, DocTestSuite, ELLIPSIS, NORMALIZE_WHITESPACE
from zope.component.testing import setUp, tearDown
optionflags = ELLIPSIS | NORMALIZE_WHITESPACE
def test_suite():
tests = [
DocFileSuite('README.txt',
src/y/o/yoma-HEAD/yoma.nspersistent/trunk/src/yoma/nspersistent/tests.py yoma(Download)
"""
from unittest import TestSuite, main
from doctest import DocFileSuite, DocTestSuite, ELLIPSIS, NORMALIZE_WHITESPACE
from zope.component.testing import setUp, tearDown
optionflags = ELLIPSIS | NORMALIZE_WHITESPACE
def test_suite():
return TestSuite((
DocFileSuite('README.txt',
src/m/a/mailinglogger-3.3.3/mailinglogger/tests/test_docs.py mailinglogger(Download)
import unittest
from shared import setUp,tearDown
from doctest import DocFileSuite, REPORT_NDIFF,ELLIPSIS
options = REPORT_NDIFF|ELLIPSIS
def test_suite():
return unittest.TestSuite((
DocFileSuite('../docs/mailinglogger.txt',
optionflags=options,
setUp=setUp,
tearDown=tearDown),
DocFileSuite('../docs/summarisinglogger.txt',
optionflags=options,
setUp=setUp,
tearDown=tearDown),
DocFileSuite('../docs/subjectformatter.txt',
optionflags=options,
setUp=setUp,
tearDown=tearDown),
src/m/a/mailinglogger-3.3.3/mailinglogger/tests/test_zope3.py mailinglogger(Download)
import unittest from zconfig import setUp,tearDown,Tests from doctest import DocFileSuite, REPORT_NDIFF,ELLIPSIS class Zope3Tests(Tests):
raise
return unittest.TestSuite()
return unittest.TestSuite((
DocFileSuite('../docs/zope3.txt',
optionflags=options,
setUp=setUp,
tearDown=tearDown),
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 Next