Fix printing stack trace while running tests

This commit is contained in:
Clint Byrum 2013-03-15 00:18:45 -07:00
parent 84a54e7558
commit bbb887decd
1 changed files with 8 additions and 3 deletions

View File

@ -55,7 +55,9 @@ def test_print_key():
t = tempfile.NamedTemporaryFile()
t.write(json.dumps(CONFIG))
t.flush()
out = subprocess.check_output([main_path(), '--metadata', t.name, '--key', 'database.url', '--type', 'raw'])
out = subprocess.check_output([main_path(), '--metadata', t.name, '--key',
'database.url', '--type', 'raw'],
stderr=subprocess.STDOUT)
assert_equals(CONFIG['database']['url'], out.rstrip())
@raises(subprocess.CalledProcessError)
@ -63,14 +65,17 @@ def test_print_key_missing():
t = tempfile.NamedTemporaryFile()
t.write(json.dumps(CONFIG))
t.flush()
out = subprocess.check_output([main_path(), '--metadata', t.name, '--key', 'does.not.exist'])
out = subprocess.check_output([main_path(), '--metadata', t.name, '--key',
'does.not.exist'], stderr=subprocess.STDOUT)
@raises(subprocess.CalledProcessError)
def test_print_key_wrong_type():
t = tempfile.NamedTemporaryFile()
t.write(json.dumps(CONFIG))
t.flush()
out = subprocess.check_output([main_path(), '--metadata', t.name, '--key', 'x', '--type', 'int'])
out = subprocess.check_output([main_path(), '--metadata', t.name, '--key',
'x', '--type', 'int'],
stderr=subprocess.STDOUT)
def test_build_tree():