summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2017-01-13 15:41:20 -0500
committerGerrit Code Review <gerrit@awstats.zzzcomputing.com>2017-01-13 15:41:20 -0500
commit2c13aa097b3588a25173eb297eee08afd18f88d6 (patch)
tree2e25114ecf738ded9a3e050d970b7a5e3a639a60 /test/sql
parent0460bc79d9986132646049d8167bd5dbe3388a65 (diff)
parentfa6dd376bb24845724287d980a98ea50eb1cfab1 (diff)
downloadsqlalchemy-2c13aa097b3588a25173eb297eee08afd18f88d6.tar.gz
Merge "Support python3.6"
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_compiler.py4
-rw-r--r--test/sql/test_metadata.py6
-rw-r--r--test/sql/test_query.py2
-rw-r--r--test/sql/test_resultset.py2
-rw-r--r--test/sql/test_returning.py2
-rw-r--r--test/sql/test_text.py14
-rw-r--r--test/sql/test_update.py4
7 files changed, 18 insertions, 16 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index 38ca09c0a..3e7c3d9a3 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -742,8 +742,8 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
assert_raises_message(
exc.InvalidRequestError,
r"Select objects don't have a type\. Call as_scalar\(\) "
- "on this Select object to return a 'scalar' "
- "version of this Select\.",
+ r"on this Select object to return a 'scalar' "
+ r"version of this Select\.",
func.coalesce, select([table1.c.myid])
)
diff --git a/test/sql/test_metadata.py b/test/sql/test_metadata.py
index f790c2aa0..ef61a7e87 100644
--- a/test/sql/test_metadata.py
+++ b/test/sql/test_metadata.py
@@ -3050,7 +3050,7 @@ class ConstraintTest(fixtures.TestBase):
return t2
assert_raises_message(
exc.ArgumentError,
- "Element Table\('t2', .* is not a string name or column element",
+ r"Element Table\('t2', .* is not a string name or column element",
Index, "foo", SomeClass()
)
@@ -4213,8 +4213,8 @@ class NamingConventionTest(fixtures.TestBase, AssertsCompiledSQL):
assert_raises_message(
exc.InvalidRequestError,
- "Naming convention including \%\(constraint_name\)s token "
- "requires that constraint is explicitly named.",
+ r"Naming convention including \%\(constraint_name\)s token "
+ r"requires that constraint is explicitly named.",
schema.CreateTable(u1).compile, dialect=default.DefaultDialect()
)
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index aca933fc9..5a201d904 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -250,7 +250,7 @@ class QueryTest(fixtures.TestBase):
a_eq(prep(r'select \foo'), r'select \foo')
a_eq(prep(r"time='12\:30:00'"), r"time='12\:30:00'")
- a_eq(prep(":this \:that"), "? :that")
+ a_eq(prep(r":this \:that"), "? :that")
a_eq(prep(r"(\:that$other)"), "(:that$other)")
a_eq(prep(r".\:that$ :other."), ".:that$ ?.")
diff --git a/test/sql/test_resultset.py b/test/sql/test_resultset.py
index 64d496a8f..561176a24 100644
--- a/test/sql/test_resultset.py
+++ b/test/sql/test_resultset.py
@@ -1409,7 +1409,7 @@ class PositionalTextTest(fixtures.TablesTest):
with assertions.expect_warnings(
r"Number of columns in textual SQL \(4\) is "
- "smaller than number of columns requested \(2\)"):
+ r"smaller than number of columns requested \(2\)"):
result = testing.db.execute(stmt)
row = result.first()
diff --git a/test/sql/test_returning.py b/test/sql/test_returning.py
index 87994ae9f..96f9eeee4 100644
--- a/test/sql/test_returning.py
+++ b/test/sql/test_returning.py
@@ -129,7 +129,7 @@ class ReturningTest(fixtures.TestBase, AssertsExecutionResults):
)
assert_raises_message(
sa_exc.InvalidRequestError,
- "Can't call inserted_primary_key when returning\(\) is used.",
+ r"Can't call inserted_primary_key when returning\(\) is used.",
getattr, result, "inserted_primary_key"
)
diff --git a/test/sql/test_text.py b/test/sql/test_text.py
index 20cb2a6fb..4a273e1ee 100644
--- a/test/sql/test_text.py
+++ b/test/sql/test_text.py
@@ -253,7 +253,8 @@ class BindParamTest(fixtures.TestBase, AssertsCompiledSQL):
def test_missing_bind_kw(self):
assert_raises_message(
exc.ArgumentError,
- "This text\(\) construct doesn't define a bound parameter named 'bar'",
+ r"This text\(\) construct doesn't define "
+ r"a bound parameter named 'bar'",
text(":foo").bindparams,
foo=5,
bar=7)
@@ -261,7 +262,8 @@ class BindParamTest(fixtures.TestBase, AssertsCompiledSQL):
def test_missing_bind_posn(self):
assert_raises_message(
exc.ArgumentError,
- "This text\(\) construct doesn't define a bound parameter named 'bar'",
+ r"This text\(\) construct doesn't define "
+ r"a bound parameter named 'bar'",
text(":foo").bindparams,
bindparam(
'foo',
@@ -273,8 +275,8 @@ class BindParamTest(fixtures.TestBase, AssertsCompiledSQL):
def test_escaping_colons(self):
# test escaping out text() params with a backslash
self.assert_compile(
- text("select * from foo where clock='05:06:07' "
- "and mork='\:mindy'"),
+ text(r"select * from foo where clock='05:06:07' "
+ r"and mork='\:mindy'"),
"select * from foo where clock='05:06:07' and mork=':mindy'",
checkparams={},
params={},
@@ -284,8 +286,8 @@ class BindParamTest(fixtures.TestBase, AssertsCompiledSQL):
def test_escaping_double_colons(self):
self.assert_compile(
text(
- "SELECT * FROM pg_attribute WHERE "
- "attrelid = :tab\:\:regclass"),
+ r"SELECT * FROM pg_attribute WHERE "
+ r"attrelid = :tab\:\:regclass"),
"SELECT * FROM pg_attribute WHERE "
"attrelid = %(tab)s::regclass",
params={'tab': None},
diff --git a/test/sql/test_update.py b/test/sql/test_update.py
index 6bacdcf72..033f2f680 100644
--- a/test/sql/test_update.py
+++ b/test/sql/test_update.py
@@ -306,8 +306,8 @@ class UpdateTest(_UpdateFromTestBase, fixtures.TablesTest, AssertsCompiledSQL):
table1 = self.tables.mytable
testing.assert_raises_message(
ValueError,
- "When preserve_parameter_order is True, values\(\) "
- "only accepts a list of 2-tuples",
+ r"When preserve_parameter_order is True, values\(\) "
+ r"only accepts a list of 2-tuples",
table1.update(preserve_parameter_order=True).values,
{"description": "foo", "name": "bar"}
)