braintree / braintree_python

Braintree Python library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
241 stars 155 forks source link

Fix test suite compatibility with Python 3.12 #154

Closed mgorny closed 8 months ago

mgorny commented 8 months ago

Summary

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

hollabaq86 commented 8 months ago

👋 @mgorny Thanks for the PR! We'll take a look and provide feedback. For internal tracking, issue 26930

mgorny commented 8 months ago

Thanks!