运行web自动化,报AttributeErrorXXX obiect has no attribute driver
问题
web自动化测试脚本,编写了 setup 和 teardown,在运行case时,报 AttributeError XXX obiect has no attribute driver
问题原因
pytest版本太高,未兼容 使用的pytest版本为 8.x.x版本
解决办法
- 将setup 和 teardown 换成 setup_class teardown_class,可以运行
- 将pytest版本降成7.x.x版本,setup和teardown可运行