module ‘‘pytest’’ has no attribute allure 问题解决
cmd 执行如下命令:
pip uninstall pytest-allure-adaptor
pip install allure-pytest
出现这个问题, 是由于 pytest-allure-adaptor 这个插件和 allure 之间存在兼容问题,
我的两台电脑都是用pytest 3.10.0 和 allure2.7, 但是就是因为这个兼容问题,
导致出问题的那台电脑, 必须要卸装掉 pytest-allure-adaptor 这个插件后安装allure-pytest ,
并且安装 allure-pytest 后, pytest 会自动升级成pytest5.4.0 , 此时可以执行脚本了.
若是强行转回pytest3.10.0 或者降级为 pytest 4.0也会出现 脚本没法执行的错误,
这是因为 pytest 5.0以下的版本不兼容 allure-pytest 导致的.
把 pytest-allure-adaptor 卸掉后, 安装allure-pytest 并且自动升级为pytest5.4.0后 , pytest + allure 的框架就基本能使用了,此时还会有一点小坑,下一章讲解