From 86a8568cd626c01b7c78d6825eb302dc853f9c9b Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 17 Jan 2020 15:40:19 +0100 Subject: [PATCH] tests: really report SQL fixture errors (#38965) Without the ON_ERROR_STOP flag `psql` does not report SQL errors thourgh its exist status. --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index c356a18..0701086 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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()