Skip to content

Commit

Permalink
[#3] call assertRaisesRegex[p] with/without final 'p' (depends on Pyt…
Browse files Browse the repository at this point in the history
…hon 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
  • Loading branch information
d-w-moore authored and alanking committed Aug 13, 2024
1 parent e9deea6 commit 9b3c7b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion irods/test/access_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,11 @@ def test_iRODSAccess_cannot_be_constructed_using_unsupported_type__issue_558(sel
# Before the fix in #558, this would have been allowed and only later would the type discrepancy be revealed,
# leading to opaque error messages. Now, the types are checked on the way in to ensure clarity and correctness.
# TODO(#480): We cannot use the unittest.assertRaises context manager as this was introduced in python 3.1.
self.assertRaisesRegex(
assertCall = getattr(self,'assertRaisesRegex',None)
if assertCall is None:
assertCall = self.assertRaisesRegexp

assertCall(
TypeError,
"'path' parameter must be of type 'str', 'irods.collection.iRODSCollection', "
"'irods.data_object.iRODSDataObject', or 'irods.path.iRODSPath'.",
Expand Down

0 comments on commit 9b3c7b3

Please sign in to comment.