Skip to content

Commit 7a7dfdd

Browse files
committed
Merge branch 'version_property'
2 parents c226759 + 8b7d0d1 commit 7a7dfdd

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

testgres/node.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,16 @@ def utils_log_file(self):
278278
def pg_log_file(self):
279279
return os.path.join(self.logs_dir, PG_LOG_FILE)
280280

281+
@property
282+
def version(self):
283+
"""
284+
Return PostgreSQL version for this node.
285+
286+
Returns:
287+
Instance of :class:`distutils.version.LooseVersion`.
288+
"""
289+
return self._pg_version
290+
281291
def _try_shutdown(self, max_attempts):
282292
attempts = 0
283293

tests/test_simple.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import tempfile
88
import testgres
99
import time
10+
import six
1011
import unittest
1112

1213
import logging.config
@@ -857,6 +858,12 @@ def test_version_management(self):
857858
self.assertTrue(b > c)
858859
self.assertTrue(a > c)
859860

861+
version = get_pg_version()
862+
with get_new_node() as node:
863+
self.assertTrue(isinstance(version, six.string_types))
864+
self.assertTrue(isinstance(node.version, PgVer))
865+
self.assertTrue(node.version == version)
866+
860867
def test_child_pids(self):
861868
master_processes = [
862869
ProcessType.AutovacuumLauncher,

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