提交 7cd0a3b9 authored 作者: Olivier Breuleux's avatar Olivier Breuleux

moving test.py to scripts subdirectory

上级 65394e78
import unittest, os, sys, traceback, commands import unittest, os, sys, traceback, commands
sys.path[0:0] = [os.path.realpath("..")]
def test_module(module_path, debugmode = False): def test_module(module_path, debugmode = False):
files = commands.getoutput("find %s -name test_*.py" % module_path) files = commands.getoutput("find %s -name test_*.py" % module_path)
suite = None suite = None
tocut = len("/".join(module_path.split("/")[:-1])) + 1
for file in files.split("\n"): for file in files.split("\n"):
file = file[tocut:]
try: try:
module = __import__(file[:-3]) module = __import__(file[:-3])
except Exception, e: except Exception, e:
...@@ -46,6 +48,6 @@ if __name__ == '__main__': ...@@ -46,6 +48,6 @@ if __name__ == '__main__':
elif len(sys.argv)>2: elif len(sys.argv)>2:
printUsage() printUsage()
test_module("theano") test_module(os.path.realpath("../theano"))
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论