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

Python: Fix missing assertRaisesRegexp method in Python 3.12 #1104

Open
Mingun opened this issue Apr 7, 2024 · 0 comments · May be fixed by kaitai-io/kaitai_struct_tests#115
Open

Python: Fix missing assertRaisesRegexp method in Python 3.12 #1104

Mingun opened this issue Apr 7, 2024 · 0 comments · May be fixed by kaitai-io/kaitai_struct_tests#115

Comments

@Mingun
Copy link

Mingun commented Apr 7, 2024

Some manual tests uses assertRaisesRegex method, that's named assertRaisesRegexp in Python 2 (and that name is used). If we want to continue support Python 2, then we should use the fix, described in this SO answer:

# Add that code somewhere in the test
if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
    setattr(unittest.TestCase, 'assertRaisesRegex', unittest.TestCase.assertRaisesRegexp)
@generalmimon generalmimon changed the title Python: Fix missing assertRaisesRegexp method in Python 3 Python: Fix missing assertRaisesRegexp method in Python 3.12 Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants