Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3b3f628

Browse files
committed
fix tests
1 parent27cf106 commit3b3f628

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

‎testgres/testgres.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def init(self, allow_streaming=False, fsync=False, initdb_params=[]):
484484

485485
ifallow_streaming:
486486
cur_ver=LooseVersion(get_pg_config()["VERSION_NUM"])
487-
min_ver=LooseVersion('9.6.0')
487+
min_ver=LooseVersion('9.6')
488488

489489
# select a proper wal_level for PostgreSQL
490490
wal_level="hot_standby"ifcur_ver<min_verelse"replica"
@@ -907,7 +907,7 @@ def catchup(self):
907907
master=self.master
908908

909909
cur_ver=LooseVersion(get_pg_config()["VERSION_NUM"])
910-
min_ver=LooseVersion('10.0')
910+
min_ver=LooseVersion('10')
911911

912912
ifcur_ver>=min_ver:
913913
poll_lsn="select pg_current_wal_lsn()::text"
@@ -1119,7 +1119,8 @@ def get_pg_config():
11191119

11201120
# Fetch version of PostgreSQL and save it as VERSION_NUM
11211121
version_parts=pg_config_data["VERSION"].split(" ")
1122-
pg_config_data["VERSION_NUM"]=version_parts[-1]
1122+
version,_,_=version_parts[-1].partition('beta')
1123+
pg_config_data["VERSION_NUM"]=version
11231124

11241125
returnpg_config_data
11251126

‎tests/test_simple.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
importlogging.config
88
importsubprocess
99

10-
fromdistutils.versionimportLooseVersion
11-
1210
fromtestgresimportInitNodeException, \
1311
StartNodeException,ExecUtilException, \
14-
BackupException,QueryException
12+
BackupException,QueryException,CatchUpException
1513

1614
fromtestgresimportget_new_node,get_pg_config
1715
fromtestgresimportbound_ports
@@ -28,8 +26,6 @@ def test_double_init(self):
2826
node.init()
2927
exceptInitNodeExceptionase:
3028
got_exception=True
31-
exceptExceptionase:
32-
pass
3329

3430
self.assertTrue(got_exception)
3531

@@ -41,8 +37,6 @@ def test_uninitialized_start(self):
4137
node.start()
4238
exceptStartNodeExceptionase:
4339
got_exception=True
44-
exceptExceptionase:
45-
pass
4640

4741
self.assertTrue(got_exception)
4842

@@ -145,21 +139,17 @@ def test_control_data(self):
145139
node.get_control_data()
146140
exceptExecUtilExceptionase:
147141
got_exception=True
148-
exceptExceptionase:
149-
pass
150142
self.assertTrue(got_exception)
151143

152144
got_exception=False
153145

154146
try:
155147
node.init()
156148
data=node.get_control_data()
157-
self.assertIsNotNode(data)
149+
self.assertIsNotNone(data)
158150
exceptExecUtilExceptionase:
159151
print(e.message)
160152
got_exception=True
161-
exceptExceptionase:
162-
pass
163153
self.assertFalse(got_exception)
164154

165155
deftest_backup_simple(self):
@@ -257,8 +247,8 @@ def test_incorrect_catchup(self):
257247
got_exception=False
258248
try:
259249
node.catchup()
260-
exceptExceptionase:
261-
pass
250+
exceptCatchUpExceptionase:
251+
got_exception=True
262252
self.assertTrue(got_exception)
263253

264254
deftest_dump(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp