8000 Default value of 'pg_options' (NodeApp::make_simple) is None · postgrespro/testgres@3fe3e94 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fe3e94

Browse files
Default value of 'pg_options' (NodeApp::make_simple) is None
1 parent 2246447 commit 3fe3e94

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

testgres/node_app.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def make_simple(
7979
set_replication: bool = False,
8080
ptrack_enable: bool = False,
8181
initdb_params: T_LIST_STR = [],
82-
pg_options: T_DICT_STR_STR = {},
82+
pg_options: typing.Optional[T_DICT_STR_STR] = None,
8383
checksum: bool = True,
8484
bin_dir: typing.Optional[str] = None
8585
) -> PostgresNode:
@@ -88,7 +88,7 @@ def make_simple(
8888
assert type(set_replication) == bool # noqa: E721
8989
assert type(ptrack_enable) == bool # noqa: E721
9090
assert type(initdb_params) == list # noqa: E721
91-
assert type(pg_options) == dict # noqa: E721
91+
assert pg_options is None or type(pg_options) == dict # noqa: E721
9292
assert type(checksum) == bool # noqa: E721
9393
assert bin_dir is None or type(bin_dir) == str # noqa: E721
9494

@@ -143,8 +143,10 @@ def make_simple(
143143
options['wal_keep_segments'] = '12'
144144

145145
# Apply given parameters
146-
for option_name, option_value in pg_options.items():
147-
options[option_name] = option_value
146+
if pg_options is not None:
147+
assert type(pg_options) == dict
148+
for option_name, option_value in pg_options.items():
149+
options[option_name] = option_value
148150

149151
# Define delayed propertyes
150152
if not ("unix_socket_directories" in options.keys()):

0 commit comments

Comments
 (0)
0