Replace the deprecated unittest.TestCase.assertRaisesRegexp() method with assertRaisesRegex(). The former is no longer present in Python 3.12, while the latter is available since Python 3.2.
Replace the deprecated imp.reload() function with importlib.reload(). The former module is no longer present in Python 3.12, while importlib.reload() is available since Python 3.4.
With these changes, unit tests pass with Python 3.12.0.
Fixes #153
Checklist
[x] Added changelog entry
[x] Ran unit tests (python3 -m unittest discover tests/unit)
[x] I understand that unless this is a Draft PR or has a DO NOT MERGE label, this PR is considered to be in a deploy ready state and can be deployed if merged to main
Summary
Replace the deprecated
unittest.TestCase.assertRaisesRegexp()
method withassertRaisesRegex()
. The former is no longer present in Python 3.12, while the latter is available since Python 3.2.Replace the deprecated
imp.reload()
function withimportlib.reload()
. The former module is no longer present in Python 3.12, whileimportlib.reload()
is available since Python 3.4.With these changes, unit tests pass with Python 3.12.0.
Fixes #153
Checklist
python3 -m unittest discover tests/unit
)