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:
parent
d5aa874116
commit
86a8568cd6
|
@ -83,7 +83,7 @@ def load_schema_db(schema):
|
||||||
|
|
||||||
# load data
|
# load data
|
||||||
for sql_path in sorted(glob.glob(os.path.join(schema_dir, '*.sql'))):
|
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,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
stdout, stderr = process.communicate()
|
stdout, stderr = process.communicate()
|
||||||
|
|
Loading…
Reference in New Issue