Skip to content

Commit 6e5d6c2

Browse files
committed
comments to explain _IRODS_VERSION
1 parent 9637452 commit 6e5d6c2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

irods/helpers/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def make_session(test_server_version=False, **kwargs):
5454

5555
env_file = env_filename_from_keyword_args(kwargs)
5656
session = iRODSSession(irods_env_file=env_file, **kwargs)
57+
# irods.test.helpers version of this function sets test_server_version True by default, so
58+
# that sessions generated for the test methods will abort on connecting with a server that
59+
# is too recent. This is a way to ensure that tests don't fail due to a server mismatch.
5760
if test_server_version:
5861
connected_version = _get_server_version_for_test(session, curtail_length=3)
5962
advertised_version = _IRODS_VERSION[:3]

irods/message/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ def ET(xml_type=(), server_version=None):
181181

182182
logger = logging.getLogger(__name__)
183183

184+
# Advertised server version compatibility. More recent servers are not guaranteed to work.
185+
# We avail ourselves of this macro in running tests to abort if the session has connected
186+
# to a server that is too new.
187+
184188
_IRODS_VERSION = (5, 0, 2, "d")
185189

186190
UNICODE = str

0 commit comments

Comments
 (0)