diff options
| author | Nate Clark <natec425@gmail.com> | 2019-02-20 12:58:18 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-02-20 18:56:47 -0500 |
| commit | 8f318692d4443300c90c7be9dc44ae3c8707f818 (patch) | |
| tree | 3b935eedfd1c31ae4c69c4996f3bae5adec2bd71 /test/sql/test_insert_exec.py | |
| parent | d879bed8786b6387b470c148b412731456793653 (diff) | |
| download | sqlalchemy-8f318692d4443300c90c7be9dc44ae3c8707f818.tar.gz | |
Include newlines in StatementError formatting
Revised the formatting for :class:`.StatementError` when stringified. Each
error detail is broken up over multiple newlines instead of spaced out on a
single line. Additionally, the SQL representation now stringifies the SQL
statement rather than using ``repr()``, so that newlines are rendered as is.
Pull request courtesy Nate Clark.
Fixes: #4500
Closes: #4501
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4501
Pull-request-sha: 60cc0ee68dc96b8f483a60d37bcb26b6c6d53efe
Change-Id: I79d8418b7495e5691c9a56f41e79495c26a967ff
Diffstat (limited to 'test/sql/test_insert_exec.py')
| -rw-r--r-- | test/sql/test_insert_exec.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/sql/test_insert_exec.py b/test/sql/test_insert_exec.py index fafe7cc9b..7905dc4bc 100644 --- a/test/sql/test_insert_exec.py +++ b/test/sql/test_insert_exec.py @@ -60,8 +60,8 @@ class InsertExecTest(fixtures.TablesTest): exc.StatementError, r"\(sqlalchemy.exc.InvalidRequestError\) A value is required for " "bind parameter 'user_name', in " - "parameter group 2 " - r"\[SQL: u?'INSERT INTO users", + "parameter group 2\n" + r"\[SQL: u?INSERT INTO users", users.insert().execute, {"user_id": 7, "user_name": "jack"}, {"user_id": 8, "user_name": "ed"}, |
