Commit f77611f0 authored by Denis Bilenko's avatar Denis Bilenko

add check for '__main__' in tests that didn't have it

parent e27075d0
......@@ -11,15 +11,17 @@ assert modules
error = 0
for path in modules:
print path
sys.stdout.flush()
res = os.system('%s %s all' % (sys.executable, path))
if res:
error = 1
print path, 'failed'
print '-----'
if error:
sys.exit(1)
if __name__ == '__main__':
for path in modules:
print path
sys.stdout.flush()
res = os.system('%s %s all' % (sys.executable, path))
if res:
error = 1
print path, 'failed'
print '-----'
if error:
sys.exit(1)
......@@ -32,6 +32,8 @@ for m, path in modules:
suite.addTest(s)
modules_count += 1
tests_count += len(s._tests)
print 'Total: %s tests in %s modules' % (tests_count, modules_count)
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)
if __name__ == '__main__':
print 'Total: %s tests in %s modules' % (tests_count, modules_count)
runner = unittest.TextTestRunner(verbosity=2)
runner.run(suite)
......@@ -11,19 +11,21 @@ assert modules
errors = []
for path in modules:
if path.endswith('server.py') or path.endswith('proxy.py'):
print path, 'skipping'
else:
print path, 'running'
sys.stdout.flush()
res = os.system('%s %s' % (sys.executable, path))
if res:
print path, 'failed'
errors.append(path)
print '-----'
if errors:
print '\n\nFailures: %s' % ', '.join(errors)
sys.exit(1)
if __name__ == '__main__':
for path in modules:
if 'server' in path or path.endswith('proxy.py') or path.endswith('webpy.py'):
print path, 'skipping'
else:
print path, 'running'
sys.stdout.flush()
res = os.system('%s %s' % (sys.executable, path))
if res:
print path, 'failed'
errors.append(path)
print '-----'
if errors:
print '\n\nFailures: %s' % ', '.join(errors)
sys.exit(1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment