tests: really report SQL fixture errors (#38965)

Without the ON_ERROR_STOP flag `psql` does not report SQL errors thourgh
its exist status.
This commit is contained in:
Benjamin Dauvergne 2020-01-17 15:40:19 +01:00
parent d5aa874116
commit 86a8568cd6
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ def load_schema_db(schema):
# load data
for sql_path in sorted(glob.glob(os.path.join(schema_dir, '*.sql'))):
process = subprocess.Popen(['psql', '--single-transaction', database_name, '-f', sql_path],
process = subprocess.Popen(['psql', '-c', '\\set ON_ERROR_STOP on', '--single-transaction', database_name, '-f', sql_path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = process.communicate()