Skip to content

Commit 89c8625

Browse files
A problem with tests.test_simple.TestgresTests.test_simple_with_bin_dir is fixed
testgres generates the exception testgres.exceptions.ExecUtilException, but test traps the exception FileNotFoundError. Error message is: Utility exited with non-zero code. Error: `bash: line 1: wrong/path/postgres: No such file or directory` Command: ('wrong/path/postgres --version',)
1 parent 6fe28a5 commit 89c8625

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Diff for: tests/test_simple.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -1244,13 +1244,19 @@ def test_simple_with_bin_dir(self):
12441244
correct_bin_dir = app.make_simple(base_dir=node.base_dir, bin_dir=bin_dir)
12451245
correct_bin_dir.slow_start()
12461246
correct_bin_dir.safe_psql("SELECT 1;")
1247+
correct_bin_dir.stop()
1248+
1249+
while True:
1250+
try:
1251+
app.make_simple(base_dir=node.base_dir, bin_dir="wrong/path")
1252+
except FileNotFoundError:
1253+
break # Expected error
1254+
except ExecUtilException:
1255+
break # Expected error
12471256

1248-
try:
1249-
wrong_bin_dir = app.make_empty(base_dir=node.base_dir, bin_dir="wrong/path")
1250-
wrong_bin_dir.slow_start()
12511257
raise RuntimeError("Error was expected.") # We should not reach this
1252-
except FileNotFoundError:
1253-
pass # Expected error
1258+
1259+
return
12541260

12551261
def test_set_auto_conf(self):
12561262
# elements contain [property id, value, storage value]

0 commit comments

Comments
 (0)