我正在使用py测试魅力适配器并尝试生成魅力报告所需的输入数据。但我无法生成任何XML的。当我使用py.test sample.py执行py文件时,它确实创建了pycache dir。然后我执行“allure generate -v 1.3.9 C:\ allurereports”(这是我在sample.py中的目录)。它确实创建了一个具有吸引力的html报告,但没有任何测试用例为0.没有任何细节存在。使用pytest生成魅力报告
的sample.py
import allure
@allure.feature('Feature1')
@allure.story('Story1')
def test_minor():
assert False
@allure.feature('Feature2')
@allure.story('Story2', 'Story3')
@allure.story('Story4')
class TestBar:
# will have 'Feature2 and Story2 and Story3 and Story4'
def test_bar(self):
pass
下面是所用的py.test命令(如在例子中给出是相同): py.test sample.py --allure_features =特征1,特征
任何人都可以帮助我如何从文件生成一个魅力报告。什么是要执行的命令。
我在安装pytest-allure-adaptor包时遇到了一些问题。它取决于'lxml',最后一个会自动安装。请参阅[Requires Distributions](https://pypi.python.org/pypi/pytest-allure-adaptor)以获取依赖关系。即,'lxml'安装会导致问题。根据[this],将'libxml2-dev'和'libxslt1-dev'软件包安装到我的系统中(http://stackoverflow.com/questions/13019942/why-cant-i-get-pip-install-lxml- to-work-within-a-virtualenv)和[this](http://stackoverflow.com/questions/5178416/pip-install-lxml-error),解决了这个问题。 – Andriy 2016-01-13 16:01:29