summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_compiler.py
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2020-03-28 17:34:05 -0600
committerGord Thompson <gord@gordthompson.com>2020-03-31 08:48:51 -0600
commit83c8231ac1821703a2ec7f07bbd68e8712101e73 (patch)
tree203039b9b1a09c907b027ccaa206effe3b43ae4e /test/dialect/postgresql/test_compiler.py
parent379e878c5854f8d0b4e65338571ba03986901ba8 (diff)
downloadsqlalchemy-83c8231ac1821703a2ec7f07bbd68e8712101e73.tar.gz
Clean up .execute calls in PostgreSQL tests
Fixes: #5220 Change-Id: I789e45dffc2b177ebb15ea3268bb965be8b06397
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r--test/dialect/postgresql/test_compiler.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py
index 316f0c240..4cc9c837d 100644
--- a/test/dialect/postgresql/test_compiler.py
+++ b/test/dialect/postgresql/test_compiler.py
@@ -87,8 +87,9 @@ class SequenceTest(fixtures.TestBase, AssertsCompiledSQL):
Column(cname[:57], Integer, primary_key=True),
)
t.create(engine)
- r = engine.execute(t.insert())
- assert r.inserted_primary_key == [1]
+ with engine.begin() as conn:
+ r = conn.execute(t.insert())
+ assert r.inserted_primary_key == [1]
class CompileTest(fixtures.TestBase, AssertsCompiledSQL):