Skip to content

Commit 9b3c7b3

Browse files
d-w-moorealanking
authored andcommitted
[#3] call assertRaisesRegex[p] with/without final 'p' (depends on Python 2 or 3)
The test: irods.test.access_test.TestAccess.test_iRODSAccess_cannot_be_constructed_using_unsupported_type__issue_558 needs this change to pass under Python2. del empty line
1 parent e9deea6 commit 9b3c7b3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

irods/test/access_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,11 @@ def test_iRODSAccess_cannot_be_constructed_using_unsupported_type__issue_558(sel
444444
# Before the fix in #558, this would have been allowed and only later would the type discrepancy be revealed,
445445
# leading to opaque error messages. Now, the types are checked on the way in to ensure clarity and correctness.
446446
# TODO(#480): We cannot use the unittest.assertRaises context manager as this was introduced in python 3.1.
447-
self.assertRaisesRegex(
447+
assertCall = getattr(self,'assertRaisesRegex',None)
448+
if assertCall is None:
449+
assertCall = self.assertRaisesRegexp
450+
451+
assertCall(
448452
TypeError,
449453
"'path' parameter must be of type 'str', 'irods.collection.iRODSCollection', "
450454
"'irods.data_object.iRODSDataObject', or 'irods.path.iRODSPath'.",

0 commit comments

Comments
 (0)