The problem: when the test suite test_integration/test_krbtpolicy.py is executed with python 3.6, it fails with the message:
def assert_error(result, pattern, returncode=None): """ Assert that ``result`` command failed and its stderr contains ``pattern``. ``pattern`` may be a ``str`` or a ``re.Pattern`` (regular expression). """ > if isinstance(pattern, re.Pattern): E AttributeError: module 're' has no attribute 'Pattern'
This happens because of change in commit 3d779b4 (part of #8142) which changed function assert_error() in ipatests/pytest_ipa/integration/tasks.py
assert_error()
The following line was added: https://pagure.io/freeipa/blob/44fca092ead0316084d68917032e28e5cbb20ad4/f/ipatests/pytest_ipa/integration/tasks.py#_1591:
if isinstance(pattern, re.Pattern):
re.Pattern class was introduced in python 3.7.
The spec file does not specify minimal version of python3, so I suppose any version should be supported.
@ftweedal Can you have a look at the issue?
I suggest to replace isinstance(pattern, re.Pattern) with duck-typing if hasattr(pattern, "search"): # re pattern.
isinstance(pattern, re.Pattern)
if hasattr(pattern, "search"): # re pattern
Metadata Update from @cheimes: - Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/4144 - Issue assigned to cheimes - Issue set to the milestone: FreeIPA 4.8.5 - Issue tagged with: tests
Hi, @sorlov. @cheimes mentioned the minimal supported Python's version for 4.8 branch as 3.6: https://fedoraproject.org/wiki/Changes/FreeIPA_Python_2_Removal
master:
ipa-4-8:
Metadata Update from @rcritten: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.