python-amcrest
python-amcrest copied to clipboard
Python 3.12+ compatible, get rid of distutils in py
Remove distutils from Python code, so it can be used with Python 3.12+. (Not converted distutils.sysconfig.get_python_lib to e.g. sysconfig.get_path)
Presently pyamcrest does not work with Home Assistant for recent months, as they now require Python 3.12+
Hi @tchellomello , may I get a review, please?
This broke test_str2bool, because it expects ValueError for strings that are not trutyh/falsy.
___________________________ TestUtils.test_str2bool ____________________________
self = <tests.test_utils.TestUtils testMethod=test_str2bool>
def test_str2bool(self):
"""Test return code from utils.str2bool."""
self.assertTrue(str2bool('y'))
self.assertTrue(str2bool('Y'))
self.assertTrue(str2bool('yes'))
self.assertTrue(str2bool(1))
self.assertFalse(str2bool('n'))
self.assertFalse(str2bool('N'))
self.assertFalse(str2bool('no'))
self.assertFalse(str2bool(0))
self.assertTrue(str2bool(u'Y'))
> self.assertRaises(ValueError, str2bool, 'amcrest')
E AssertionError: ValueError not raised by str2bool
tests/test_utils.py:31: AssertionError
test_str2bool
let me take a look, I did not realize the test does not run
@mweinelt , #240