Skip to content

Commit 811bb69

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

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/test_worker_behavior.py

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

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

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

0 commit comments

Comments
 (0)