Example #1
0
def run_doctests(files):
    print
    print 'Doctests'
    print '========'
    for x in files:
        print x,
        sys.stdout.flush()
        with file(x) as f:
            g = StringIO()
            if run(f.read(), g):
                yield [x, g.getvalue()]
                print red % 'fail'
            else:
                print green % 'pass'
Example #2
0
print 'Doctests'
print '========'

for x in sorted(path('test').glob("*/*.dynadoc")):

    if '/ptb.dynadoc' in x:
        continue

    if '/known-failures/' in x:
        continue

    print x,
    sys.stdout.flush()
    with file(x) as f:
        g = StringIO()
        if run(f.read(), g):
            failures.append([x, g.getvalue()])
            print red % 'fail'
        else:
            print green % 'pass'


for f, log in failures:
    print
    print '================================================'
    print f
    print '================================================'
    print log


if failures: