提交 e5cf9243 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Merge pull request #499 from lamblin/better_nosetest_followup

Use sys.executable instead of 'python'
...@@ -94,8 +94,10 @@ def run(stdout, stderr, argv, theano_nose, batch_size): ...@@ -94,8 +94,10 @@ def run(stdout, stderr, argv, theano_nose, batch_size):
dummy_in = open(os.devnull) dummy_in = open(os.devnull)
# We need to call 'python' on Windows, because theano-nose is not a # We need to call 'python' on Windows, because theano-nose is not a
# native Windows app; and it does not hurt to call it on Unix. # native Windows app; and it does not hurt to call it on Unix.
# Using sys.executable, so that the same Python version is used.
python = sys.executable
rval = subprocess.call( rval = subprocess.call(
(['python', theano_nose, '--collect-only', '--with-id'] ([python, theano_nose, '--collect-only', '--with-id']
+ other_args), + other_args),
stdin=dummy_in.fileno(), stdin=dummy_in.fileno(),
stdout=stdout.fileno(), stdout=stdout.fileno(),
...@@ -122,7 +124,7 @@ def run(stdout, stderr, argv, theano_nose, batch_size): ...@@ -122,7 +124,7 @@ def run(stdout, stderr, argv, theano_nose, batch_size):
# failed tests, which are re-run (with output) below. # failed tests, which are re-run (with output) below.
dummy_out = open(os.devnull, 'w') dummy_out = open(os.devnull, 'w')
rval = subprocess.call( rval = subprocess.call(
(['python', theano_nose, '-q', '--with-id'] ([python, theano_nose, '-q', '--with-id']
+ map(str, test_range) + map(str, test_range)
+ other_args), + other_args),
stdout=dummy_out.fileno(), stdout=dummy_out.fileno(),
...@@ -146,7 +148,7 @@ def run(stdout, stderr, argv, theano_nose, batch_size): ...@@ -146,7 +148,7 @@ def run(stdout, stderr, argv, theano_nose, batch_size):
stdout.flush() stdout.flush()
stderr.flush() stderr.flush()
subprocess.call( subprocess.call(
(['python', theano_nose, '-v', '--with-id'] ([python, theano_nose, '-v', '--with-id']
+ failed + failed
+ other_args), + other_args),
stdin=dummy_in.fileno(), stdin=dummy_in.fileno(),
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论