常见错误
报错:TypeError: setUpClass() missing 1 required positional argument: ‘cls’
- 解决办法如上图
报错:TypeError: a bytes-like object is required, not ‘str’
###报错:ERROR: usage: pytest [options][file_or_dir] [file_or_dir][…]
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --reruns
inifile: None
rootdir: C:\Users\Administrator\PycharmProjects\测试宝典
解决办法
- 把pytest-rerunfailures插件 卸载掉,然后用cmd命令执行 pip install pytest-rerunfailures 即可解决
ModuleNotFoundError: No module named ‘pytest_exercise’
####ERROR abc_123.py - ValueError: No closing quotation
abc_123.py::Login::case_add_1 is using nose-specific method: setup(self)
[外链图片转存中…(img-HWFWczDA-1725267795321)]