Skip to content

Commit 4f4120d

Browse files
committed
test: prove drop database with force works ok
1 parent e8ec709 commit 4f4120d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_worker_behavior.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ def test_worker_will_not_block_drop_database(autocommit_sess):
2020
assert result is not None
2121
assert result == 1
2222

23+
(pg_version,) = sess.execute(text(
24+
"""
25+
select current_setting('server_version_num');
26+
"""
27+
)).fetchone()
28+
29+
if int(pg_version) >= 130000:
30+
31+
autocommit_sess.execute(text("create database foo;"))
32+
autocommit_sess.execute(text("drop database foo with (force);"))
33+
34+
(result,) = autocommit_sess.execute(text("""
35+
select 1
36+
""")).fetchone()
37+
38+
assert result is not None
39+
assert result == 1
40+
2341

2442
def test_success_when_worker_is_up(sess):
2543
"""net.check_worker_is_up should not return anything when the worker is running"""

0 commit comments

Comments
 (0)