From fa6dd376bb24845724287d980a98ea50eb1cfab1 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 11 Jan 2017 10:12:12 -0500 Subject: 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 --- test/sql/test_text.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'test/sql/test_text.py') 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}, -- cgit v1.2.1