From d455135338d84dfac2a2b98f52cde1d43dd87681 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 25 Jul 2010 23:46:24 +0200 Subject: [PATCH] Added a workaround for py.test --- tests/flaskext_test.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/flaskext_test.py b/tests/flaskext_test.py index 3614ad58..c7eb37df 100644 --- a/tests/flaskext_test.py +++ b/tests/flaskext_test.py @@ -216,13 +216,22 @@ def test_extension(name, interpreters, flask_dep): # figure out the test command and write a wrapper script. We # can't write that directly into the tox ini because tox does # not invoke the command from the shell so we have no chance - # to pipe the output into a logfile + # to pipe the output into a logfile. The /dev/null hack is + # to trick py.test (if used) into not guessing widths from the + # invoking terminal. test_command = get_test_command(checkout_path) log('Test command: %s', test_command) f = open(checkout_path + '/flaskext-runtest.sh', 'w') - f.write(test_command + ' &> "$1"\n') + f.write(test_command + ' &> "$1" < /dev/null\n') f.close() + # if there is a tox.ini, remove it, it will cause troubles + # for us. Remove it if present, we are running tox ourselves + # afterall. + toxini = os.path.join(checkout_path, 'tox.ini') + if os.path.isfile(toxini): + os.remove(toxini) + create_tox_ini(checkout_path, interpreters, flask_dep) rv = subprocess.call(['tox'], cwd=checkout_path) return TestResult(name, checkout_path, rv, interpreters)