예제 #1
0
    def fulltestsuite():
        """
        """
        pkg = saneimport(pkgname)
        path = pkgpath(pkg)

        doctestfiles = recursedir(
                path,
                cond=ispkgdir,
                filefilter=scanfordoctest,
                )
        # make relative to pkg path
        doctestfiles = [x[len(path)+1:] for x in doctestfiles]
        doctests = [testsuite(x) for x in doctestfiles+files]

        test_suite = unittest.TestSuite(doctests)
        return test_suite
예제 #2
0
    def testsuite(doctestfile):
        if doctestfile.endswith('.txt'):
            doctest = doctestunit.DocFileSuite(doctestfile,
                    package=pkgname,
                    setUp=setUp, tearDown=tearDown,
                    optionflags=optionflags,
                    )
            return doctest

        if doctestfile.endswith('.py'):
            module = doctestfile.replace('.py','').replace(os.sep, '.')
            module = '.'.join((pkgname, module,))
            module = saneimport(module)
            doctest = doctestunit.DocTestSuite(module,
                    setUp=setUp, tearDown=tearDown,
                    optionflags=optionflags,
                    )
            return doctest