Skip to content

Commit 939ca6d

Browse files
TestTestgresCommon::test_get_pg_config2 is added
1 parent ee441ca commit 939ca6d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/test_testgres_common.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from ..testgres.node import PgVer
66
from ..testgres.node import PostgresNode
77
from ..testgres.utils import get_pg_version2
8+
from ..testgres.utils import get_pg_config2
89
from ..testgres.utils import file_tail
910
from ..testgres.utils import get_bin_path2
1011
from ..testgres import ProcessType
@@ -1064,6 +1065,31 @@ def test_dump(self, os_ops: OsOperations):
10641065
res = node3.execute(query_select)
10651066
assert (res == [(1, ), (2, )])
10661067

1068+
def test_get_pg_config2(self, os_ops: OsOperations):
1069+
# check same instances
1070+
a = get_pg_config2(os_ops, None)
1071+
b = get_pg_config2(os_ops, None)
1072+
assert (id(a) == id(b))
1073+
1074+
# save right before config change
1075+
c1 = get_pg_config2(os_ops, None)
1076+
1077+
# modify setting for this scope
1078+
with scoped_config(cache_pg_config=False) as config:
1079+
# sanity check for value
1080+
assert not (config.cache_pg_config)
1081+
1082+
# save right after config change
1083+
c2 = get_pg_config2(os_ops, None)
1084+
1085+
# check different instances after config change
1086+
assert (id(c1) != id(c2))
1087+
1088+
# check different instances
1089+
a = get_pg_config2(os_ops, None)
1090+
b = get_pg_config2(os_ops, None)
1091+
assert (id(a) != id(b))
1092+
10671093
@staticmethod
10681094
def helper__get_node(os_ops: OsOperations, name=None):
10691095
assert isinstance(os_ops, OsOperations)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy