Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipatests: make assert_error function compatible with python version < 3.7 #4146

Closed
wants to merge 1 commit into from

Conversation

wladich
Copy link

@wladich wladich commented Jan 21, 2020

In 3d779b4 assert_error was changed to handle both strings and compiled
regexp objects in argument pattern. For this it used expression
isinstance(pattern, re.Pattern). re.Pattern object was introduced in
python 3.7, so the tests which call this function can not be executed
with older versions of python though and for now we claim support for
python 3.6+.
Fixed by replacing the condition with duck-typing check.

Fixes: https://pagure.io/freeipa/issue/8179

@wladich wladich added the ipa-4-8 Mark for backport to ipa 4.8 label Jan 21, 2020
… 3.7

In 3d779b4 assert_error was changed to handle both strings and compiled
regexp objects in argument `pattern`. For this it used expression
`isinstance(pattern, re.Pattern)`. re.Pattern object was introduced in
python 3.7, so the tests which call this function can not be executed
with older versions of python though and for now we claim support for
python 3.6+.
Fixed by replacing the condition with duck-typing check.


Fixes: https://pagure.io/freeipa/issue/8179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ipa-4-8 Mark for backport to ipa 4.8
Projects
None yet
2 participants