summaryrefslogtreecommitdiff
path: root/test/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-01-11 10:12:12 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2017-01-13 10:57:41 -0500
commitfa6dd376bb24845724287d980a98ea50eb1cfab1 (patch)
tree91e536c76f4b76b8997b02f5cd5a41de29dc90ef /test/engine
parentc703b9ce89483b6f44b97d1fbf56f8df8b14305a (diff)
downloadsqlalchemy-fa6dd376bb24845724287d980a98ea50eb1cfab1.tar.gz
Support python3.6
Corrects some warnings and adds tox config. Adds DeprecationWarning to the error category. Large sweep for string literals w/ backslashes as this is common in docstrings Co-authored-by: Andrii Soldatenko Fixes: #3886 Change-Id: Ia7c838dfbbe70b262622ed0803d581edc736e085 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/337
Diffstat (limited to 'test/engine')
-rw-r--r--test/engine/test_execute.py6
-rw-r--r--test/engine/test_logging.py20
-rw-r--r--test/engine/test_transaction.py4
3 files changed, 15 insertions, 15 deletions
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py
index 49b29f7f2..c9f78aa5e 100644
--- a/test/engine/test_execute.py
+++ b/test/engine/test_execute.py
@@ -292,7 +292,7 @@ class ExecuteTest(fixtures.TestBase):
assert_raises_message(
tsa.exc.StatementError,
r"\(test.engine.test_execute.SomeException\) "
- "nope \[SQL\: u?'SELECT 1 ",
+ r"nope \[SQL\: u?'SELECT 1 ",
conn.execute,
select([1]).
where(
@@ -1636,7 +1636,7 @@ class HandleErrorTest(fixtures.TestBase):
assert_raises_message(
tsa.exc.StatementError,
r"\(test.engine.test_execute.SomeException\) "
- "nope \[SQL\: u?'SELECT 1 ",
+ r"nope \[SQL\: u?'SELECT 1 ",
conn.execute,
select([1]).where(
column('foo') == literal('bar', MyType()))
@@ -1828,7 +1828,7 @@ class HandleErrorTest(fixtures.TestBase):
assert_raises_message(
tsa.exc.StatementError,
r"\(test.engine.test_execute.SomeException\) "
- "nope \[SQL\: u?'SELECT 1 ",
+ r"nope \[SQL\: u?'SELECT 1 ",
conn.execute,
select([1]).where(
column('foo') == literal('bar', MyType()))
diff --git a/test/engine/test_logging.py b/test/engine/test_logging.py
index 51ebc5250..e9bc23b41 100644
--- a/test/engine/test_logging.py
+++ b/test/engine/test_logging.py
@@ -185,11 +185,11 @@ class LogParamsTest(fixtures.TestBase):
assert_raises_message(
tsa.exc.DBAPIError,
r".*'INSERT INTO nonexistent \(data\) values \(:data\)'\] "
- "\[parameters: "
- "\[{'data': '0'}, {'data': '1'}, {'data': '2'}, "
- "{'data': '3'}, {'data': '4'}, {'data': '5'}, "
- "{'data': '6'}, {'data': '7'} ... displaying 10 of "
- "100 total bound parameter sets ... {'data': '98'}, {'data': '99'}\]",
+ r"\[parameters: "
+ r"\[{'data': '0'}, {'data': '1'}, {'data': '2'}, "
+ r"{'data': '3'}, {'data': '4'}, {'data': '5'}, "
+ r"{'data': '6'}, {'data': '7'} ... displaying 10 of "
+ r"100 total bound parameter sets ... {'data': '98'}, {'data': '99'}\]",
lambda: self.eng.execute(
"INSERT INTO nonexistent (data) values (:data)",
[{"data": str(i)} for i in range(100)]
@@ -200,11 +200,11 @@ class LogParamsTest(fixtures.TestBase):
assert_raises_message(
tsa.exc.DBAPIError,
r".*INSERT INTO nonexistent \(data\) values "
- "\(\?\)'\] \[parameters: \[\('0',\), \('1',\), \('2',\), \('3',\), "
- "\('4',\), \('5',\), \('6',\), \('7',\) "
- "... displaying "
- "10 of 100 total bound parameter sets ... "
- "\('98',\), \('99',\)\]",
+ r"\(\?\)'\] \[parameters: \[\('0',\), \('1',\), \('2',\), \('3',\), "
+ r"\('4',\), \('5',\), \('6',\), \('7',\) "
+ r"... displaying "
+ r"10 of 100 total bound parameter sets ... "
+ r"\('98',\), \('99',\)\]",
lambda: self.eng.execute(
"INSERT INTO nonexistent (data) values (?)",
[(str(i), ) for i in range(100)]
diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py
index 82a0c6317..7e95fb4fa 100644
--- a/test/engine/test_transaction.py
+++ b/test/engine/test_transaction.py
@@ -227,7 +227,7 @@ class TransactionTest(fixtures.TestBase):
with expect_warnings(
"An exception has occurred during handling of a previous "
"exception. The previous exception "
- "is:.*..SQL\:.*RELEASE SAVEPOINT"
+ r"is:.*..SQL\:.*RELEASE SAVEPOINT"
):
def go():
with connection.begin_nested() as savepoint:
@@ -235,7 +235,7 @@ class TransactionTest(fixtures.TestBase):
connection, savepoint._savepoint)
assert_raises_message(
exc.DBAPIError,
- ".*SQL\:.*ROLLBACK TO SAVEPOINT",
+ r".*SQL\:.*ROLLBACK TO SAVEPOINT",
go
)