diff options
author | Gord Thompson <gord@gordthompson.com> | 2021-07-26 12:52:23 -0600 |
---|---|---|
committer | Gord Thompson <gord@gordthompson.com> | 2021-07-26 14:00:53 -0600 |
commit | 2c4a497a0c7f3981be38340089cbb5f32e376b03 (patch) | |
tree | 84ff588f3f48afc4db2b4a401293c4332f7898de /test/dialect/mssql/test_compiler.py | |
parent | c6b1d24fe71c22e4d2117d084f06df3597671985 (diff) | |
download | sqlalchemy-2c4a497a0c7f3981be38340089cbb5f32e376b03.tar.gz |
Modernize tests - dml_values
Change-Id: Ida86ed40c43d91813151621b847376976773a5f9
Diffstat (limited to 'test/dialect/mssql/test_compiler.py')
-rw-r--r-- | test/dialect/mssql/test_compiler.py | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/test/dialect/mssql/test_compiler.py b/test/dialect/mssql/test_compiler.py index c512ae441..6afd90e87 100644 --- a/test/dialect/mssql/test_compiler.py +++ b/test/dialect/mssql/test_compiler.py @@ -864,15 +864,17 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): column("name", String(128)), column("description", String(128)), ) - u = update(table1, values=dict(name="foo")).returning( - table1.c.myid, table1.c.name + u = ( + update(table1) + .values(dict(name="foo")) + .returning(table1.c.myid, table1.c.name) ) self.assert_compile( u, "UPDATE mytable SET name=:name OUTPUT " "inserted.myid, inserted.name", ) - u = update(table1, values=dict(name="foo")).returning(table1) + u = update(table1).values(dict(name="foo")).returning(table1) self.assert_compile( u, "UPDATE mytable SET name=:name OUTPUT " @@ -880,7 +882,8 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "inserted.description", ) u = ( - update(table1, values=dict(name="foo")) + update(table1) + .values(dict(name="foo")) .returning(table1) .where(table1.c.name == "bar") ) @@ -891,8 +894,10 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "inserted.description WHERE mytable.name = " ":name_1", ) - u = update(table1, values=dict(name="foo")).returning( - func.length(table1.c.name) + u = ( + update(table1) + .values(dict(name="foo")) + .returning(func.length(table1.c.name)) ) self.assert_compile( u, @@ -929,8 +934,10 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): column("name", String(128)), column("description", String(128)), ) - i = insert(table1, values=dict(name="foo")).returning( - table1.c.myid, table1.c.name + i = ( + insert(table1) + .values(dict(name="foo")) + .returning(table1.c.myid, table1.c.name) ) self.assert_compile( i, @@ -938,15 +945,17 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): "inserted.myid, inserted.name VALUES " "(:name)", ) - i = insert(table1, values=dict(name="foo")).returning(table1) + i = insert(table1).values(dict(name="foo")).returning(table1) self.assert_compile( i, "INSERT INTO mytable (name) OUTPUT " "inserted.myid, inserted.name, " "inserted.description VALUES (:name)", ) - i = insert(table1, values=dict(name="foo")).returning( - func.length(table1.c.name) + i = ( + insert(table1) + .values(dict(name="foo")) + .returning(func.length(table1.c.name)) ) self.assert_compile( i, |