Re: How to perform unit testing
Posted by:
hao peng
Date: June 08, 2023 09:20PM
Thank you. Successfully operated like you did. But I have encountered a new problem again, please help me take a look.
I suspect it is a Python version issue, but I have tried several different versions and still have this issue
python3 unittests.py --use-external-server -H 11.11.1.11 --port=3306 --user=root --password=123456
2023-06-09 10:38:28,021 [myconnpy_tests:INFO] MySQL Connector/Python unittest using Python v3.7.3
2023-06-09 10:38:28,479 [myconnpy_tests:INFO] Creating 'myconnpy' database
2023-06-09 10:38:28,689 [myconnpy_tests:INFO] Installing Connector/Python in /data/2/mysql-connector-python/build/testing
Traceback (most recent call last):
File "unittests.py", line 1249, in <module>
main()
File "unittests.py", line 1103, in main
options.debug,
File "/data/2/mysql-connector-python/tests/__init__.py", line 891, in install_connector
cmd_build = dist.get_command_obj("build")
File "/usr/local/python3/lib/python3.7/distutils/dist.py", line 858, in get_command_obj
cmd_obj = self.command_obj[command] = klass(self)
File "/usr/local/python3/lib/python3.7/site-packages/setuptools/__init__.py", line 163, in __init__
_Command.__init__(self, dist)
File "/usr/local/python3/lib/python3.7/distutils/cmd.py", line 57, in __init__
raise TypeError("dist must be a Distribution instance")
TypeError: dist must be a Distribution instance