python 的unittest 没有自带数据驱动功能。
所以如果使用unittest,同时又想使用数据驱动,那么就可以使用DDT来完成。
DDT是 “Data-Driven Tests”的缩写。
1.在CMD中输入pip install ddt报如下错:
Collecting ddt
Using cached https://files.pythonhosted.org/packages/cf/f5/f83dea32dc3fb3be1e5afab8438dce73ed587740a2a061ae2ea56e04a36d/ddt-1.2.1-py2.py3-none-any.whl
Installing collected packages: ddt
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'c:\\program files\\python37\\Lib\\site-packages\\ddt.py'
Consider using the `--user` option or check the permissions.
You are using pip version 18.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
2.解决办法:pip install --user ddt