def test_main():
    suite = unittest.TestSuite()
    if sys.flags.optimize >= 2:
        print >> sys.stderr, "test_threading_local --",
        print >> sys.stderr, "skipping some tests due to -O flag."
        sys.stderr.flush()
    else:
        suite.addTest(DocTestSuite('_threading_local'))
    suite.addTest(unittest.makeSuite(ThreadingLocalTest))

    try:
        from thread import _local
    except ImportError:
        pass
    else:
        if sys.flags.optimize <= 1:
            import _threading_local
            local_orig = _threading_local.local

            def setUp(test):
                _threading_local.local = _local

            def tearDown(test):
                _threading_local.local = local_orig

            suite.addTest(
                DocTestSuite('_threading_local',
                             setUp=setUp,
                             tearDown=tearDown))

    test_support.run_unittest(suite)
Пример #2
0
def test_main():
    suite = unittest.TestSuite()
    suite.addTest(DocTestSuite('_threading_local'))
    if support.is_jython:
        del ThreadingLocalTest.test_local_refs
    suite.addTest(unittest.makeSuite(ThreadingLocalTest))

    try:
        from _thread import _local
    except ImportError:
        pass
    else:
        import _threading_local
        local_orig = _threading_local.local

        def setUp(test):
            _threading_local.local = _local

        def tearDown(test):
            _threading_local.local = local_orig

        suite.addTest(
            DocTestSuite('_threading_local', setUp=setUp, tearDown=tearDown))

    support.run_unittest(suite)
Пример #3
0
def load_tests(loader, tests, ignore):
    tests.addTests(DocTestSuite(structspec))
    tests.addTests(DocTestSuite(structspec.common))
    tests.addTests(DocTestSuite(structspec.languages))
    tests.addTests(DocTestSuite(structspec.languages.c))
    tests.addTests(DocTestSuite(structspec.languages.python))
    return tests
Пример #4
0
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(DocTestSuite(
        'lp.services.scripts.logger', tearDown=tearDown
        ))
    suite.addTest(DocTestSuite('lp.services.scripts'))
    return suite
Пример #5
0
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(DocTestSuite())
    suite.addTest(DocTestSuite(helpers))
    suite.addTest(
        unittest.TestLoader().loadTestsFromTestCase(TruncateTextTest))
    return suite
Пример #6
0
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(DocTestSuite(checker=checker))
    suite.addTest(
        DocTestSuite(checker=checker,
                     extraglobs={"DisplayWidget": UnicodeDisplayWidget}))
    return suite
Пример #7
0
def load_tests(loader, tests, pattern):
    suite = unittest.TestSuite()

    suite.addTests(tests)
    suite.addTest(DocTestSuite(util))
    suite.addTest(DocTestSuite(oath))

    return suite
Пример #8
0
def load_tests(loader, tests, ignore):  # (this is a unittest API hook-in)
    tests.addTests(DocTestSuite(subject_module()))
    # `oxford_join` hi.

    from text_lib.magnetics import words_via_time as mod
    tests.addTests(DocTestSuite(mod))

    return tests
Пример #9
0
def test_suite():
    return unittest.TestSuite((
        unittest.makeSuite(RenamerTest),
        DocTestSuite('zope.copypastemove',
                     setUp=setUp,
                     tearDown=testing.tearDown),
        DocTestSuite(setUp=setUp, tearDown=testing.tearDown),
    ))
def test_suite():
    options = doctest.ELLIPSIS
    return unittest.TestSuite((
        DocTestSuite('zope.app.renderer.plaintext'),
        DocTestSuite('zope.app.renderer.rest'),
        DocTestSuite('zope.app.renderer.stx',
                     optionflags=options),
    ))
Пример #11
0
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(DocTestSuite("zope.container.ordered",
                               setUp=testing.setUp,
                               tearDown=testing.tearDown))
    suite.addTest(DocTestSuite(
            setUp=testing.ContainerPlacefulSetup().setUp,
            tearDown=testing.ContainerPlacefulSetup().tearDown))
    return suite
Пример #12
0
def load_tests(*_):
    """Load doctests as unittest test suite.

    For the parameters, see :mod:`unittest`. The parameters are unused here.
    """
    suite = TestSuite()
    suite.addTests(DocTestSuite('COT.data_validation'))
    suite.addTests(DocTestSuite('COT.utilities'))
    return suite
Пример #13
0
def test_suite():
    return unittest.TestSuite(
        (DocTestSuite('zope.configuration.xmlconfig'), DocTestSuite(),
         DocFileSuite('../exclude.txt',
                      checker=renormalizing.RENormalizing([
                          (re.compile('include [^\n]+zope.configuration[\S+]'),
                           'include /zope.configuration\2'),
                          (re.compile(r'\\'), '/'),
                      ]))))
Пример #14
0
def load_tests(loader, tests, pattern):
    suite = unittest.TestSuite()

    suite.addTests(tests)
    suite.addTest(DocTestSuite(crc))
    suite.addTest(DocTestSuite(modhex))
    suite.addTest(DocTestSuite(otp))

    return suite
Пример #15
0
def test_suite():
    doctests = [
        DocTestSuite(),
        DocTestSuite(setUp=setUpFrozenSet),
    ]
    if sys.version_info[:2] < (2, 6):
        doctests.append(DocTestSuite(setUp=setUpSet))
        doctests.append(DocTestSuite(setUp=setUpImmutableSet))
    return unittest.TestSuite(doctests)
Пример #16
0
def load_tests(*_):
    """Load doctests as unittest test suite.

    For the parameters, see :mod:`unittest`. The parameters are unused here.
    """
    suite = TestSuite()
    suite.addTests(DocTestSuite('COT.vm_description.ovf.item'))
    suite.addTests(DocTestSuite('COT.vm_description.ovf.utilities'))
    return suite
Пример #17
0
def test_suite():
    return unittest.TestSuite((
        unittest.makeSuite(TeaTest),
        unittest.makeSuite(XTeaTest),
        unittest.makeSuite(XXTeaTest),
        DocTestSuite('crypttea.tea'),
        DocTestSuite('crypttea.xtea'),
        DocTestSuite('crypttea.xxtea'),
        DocTestSuite('crypttea._common'),
    ))
Пример #18
0
def test_suite():
    checker = renormalizing.RENormalizing([
        (re.compile(r" with base 10: '125.6'"), r': 125.6')
    ])
    return TestSuite((
        makeSuite(FieldTest),
        makeSuite(FieldDefaultBehaviour),
        DocTestSuite("zope.schema._field"),
        DocTestSuite("zope.schema._bootstrapfields", checker=checker),
    ))
Пример #19
0
def load_tests(loader, tests, ignore):
    """Run our main documentation as a test."""

    # Python 2.6 formats floating-point numbers a bit differently and
    # breaks the doctest.
    if sys.version_info >= (2, 7):
        tests.addTests(DocTestSuite('sgp4', optionflags=ELLIPSIS))
        tests.addTests(DocTestSuite('sgp4.functions', optionflags=ELLIPSIS))

    return tests
def test_suite():
    suites = (
        DocFileSuite('messages.txt', package='Products.CMFPlone.tests'),
        DocTestSuite('Products.CMFPlone.i18nl10n'),
        DocTestSuite('Products.CMFPlone.TranslationServiceTool'),
        DocTestSuite('Products.CMFPlone.utils'),
        DocTestSuite('Products.CMFPlone.workflow'),
    )

    return TestSuite(suites)
Пример #21
0
def test_suite():
    checker = renormalizing.RENormalizing([
        (re.compile(r"<type 'exceptions.(\w+)Error'>:"),
                    r'exceptions.\1Error:'),
        ])
    return unittest.TestSuite((
        DocTestSuite('zope.configuration.fields'),
        DocTestSuite('zope.configuration.config',checker=checker),
        DocTestSuite(),
        ))
Пример #22
0
def load_tests(*_):
    """Load doctests as unittest test suite.

    For the parameters, see :mod:`unittest`. The parameters are unused here.
    """
    suite = TestSuite()
    suite.addTests(DocTestSuite('COT.commands.add_disk'))
    suite.addTests(DocTestSuite('COT.commands.deploy'))
    suite.addTests(DocTestSuite('COT.commands.edit_hardware'))
    suite.addTests(DocTestSuite('COT.commands.edit_properties'))
    return suite
Пример #23
0
def load_tests(loader, tests, pattern):
    tests.addTest(DocTestSuite('_threading_local'))

    local_orig = _threading_local.local
    def setUp(test):
        _threading_local.local = _thread._local
    def tearDown(test):
        _threading_local.local = local_orig
    tests.addTests(DocTestSuite('_threading_local',
                                setUp=setUp, tearDown=tearDown)
                   )
    return tests
Пример #24
0
def load_tests(loader, tests, ignore):
    """Run our main documentation as a test, plus all test functions."""

    from sgp4.wulfgar import add_test_functions
    add_test_functions(loader, tests, __name__)

    # Python 2.6 formats floating-point numbers a bit differently and
    # breaks the doctest, so we only run the doctest on later versions.
    if sys.version_info >= (2, 7):
        tests.addTests(DocTestSuite('sgp4', optionflags=ELLIPSIS))
        tests.addTests(DocTestSuite('sgp4.functions', optionflags=ELLIPSIS))

    return tests
Пример #25
0
def test_suite():
    suites = (
        DocFileSuite('messages.txt', package='Products.CMFPlone.tests'),
        DocTestSuite('Products.CMFPlone.CalendarTool'),
        DocTestSuite('Products.CMFPlone.i18nl10n'),
        ZopeDocTestSuite('Products.CMFPlone.PloneTool',
                         test_class=FunctionalTestCase),
        DocTestSuite('Products.CMFPlone.TranslationServiceTool'),
        DocTestSuite('Products.CMFPlone.utils'),
        DocTestSuite('Products.CMFPlone.workflow'),
    )

    return TestSuite(suites)
Пример #26
0
def load_tests(loader=None, tests=None, pattern=None):
    suite = TestSuite()
    suite.addTests(DocTestSuite('arcade.draw_commands'))
    suite.addTests(DocTestSuite('arcade.buffered_draw_commands'))
    suite.addTests(DocTestSuite('arcade.window_commands'))
    suite.addTests(DocTestSuite('arcade.geometry'))
    suite.addTests(DocTestSuite('arcade.sprite'))
    suite.addTests(DocTestSuite('arcade.sprite_list'))
    suite.addTests(DocTestSuite('arcade.application'))
    suite.addTests(DocTestSuite('arcade.sound'))
    suite.addTests(DocTestSuite('arcade.physics_engines'))
    suite.addTests(DocTestSuite('arcade.decorator_support'))
    return suite
Пример #27
0
def test_main():
    suite = unittest.TestSuite()
    suite.addTest(DocTestSuite('_threading_local'))
    suite.addTest(unittest.makeSuite(ThreadLocalTest))
    suite.addTest(unittest.makeSuite(PyThreadingLocalTest))
    local_orig = _threading_local.local

    def setUp(test):
        _threading_local.local = _thread._local

    def tearDown(test):
        _threading_local.local = local_orig
    suite.addTest(DocTestSuite('_threading_local', setUp=setUp, tearDown=
        tearDown))
    support.run_unittest(suite)
Пример #28
0
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(Python_ZSPTests, 'test'))
    suite.addTest(unittest.makeSuite(C_ZSPTests, 'test'))
    suite.addTest(DocTestSuite())
    suite.addTest(unittest.makeSuite(GetRolesWithMultiThreadTest))
    return suite
Пример #29
0
def test_suite():
    suite = unittest.TestSuite()
    suite.addTest(
        DocTestSuite('lp.services.webapp.servers',
                     optionflags=NORMALIZE_WHITESPACE | ELLIPSIS))
    suite.addTest(unittest.TestLoader().loadTestsFromName(__name__))
    return suite
Пример #30
0
def test_suite():
    """Return a suite of canonical.conf and all conf files."""
    suite = unittest.TestSuite()
    suite.addTest(DocTestSuite(
        'lp.services.config',
        optionflags=NORMALIZE_WHITESPACE | ELLIPSIS,
        ))
    load_testcase = unittest.defaultTestLoader.loadTestsFromTestCase
    # Add a test for every launchpad[.lazr].conf file in our tree.
    for config_dir in lp.services.config.CONFIG_ROOT_DIRS:
        for dirpath, dirnames, filenames in os.walk(config_dir):
            if os.path.basename(dirpath) in EXCLUDED_CONFIGS:
                del dirnames[:]  # Don't look in subdirectories.
                continue
            for filename in filenames:
                if filename == 'launchpad.conf':
                    config_file = os.path.join(dirpath, filename)
                    description = os.path.relpath(config_file, config_dir)
                    suite.addTest(make_test(config_file, description))
                elif filename.endswith('-lazr.conf'):
                    # Test the lazr.config conf files.
                    config_file = os.path.join(dirpath, filename)
                    description = os.path.relpath(config_file, config_dir)
                    testcase = make_config_test(config_file, description)
                    suite.addTest(load_testcase(testcase))
                else:
                    # This file is not a config that can be validated.
                    pass
    # Other tests.
    suite.addTest(load_testcase(TestLaunchpadConfig))
    return suite