The pytest framework makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries.
pytest 框架使编写小型测试变得容易,但可以扩展以支持应用程序和库的复杂功能测试。
关于没有 allure 命令,是因为 allure 命令需要单独安装。
2.1. Installing a commandline
Several options for Allure installation are currently supported:
2.1.1. Linux
For debian-based repositories a PPA is provided:
sudo apt-add-repository ppa:qameta/allure
sudo apt-get update
sudo apt-get install allure
2.1.2. Mac OS X
For Mas OS, automated installation is available via Homebrew
brew install allure
2.1.3. Windows
For Windows, Allure is available from the Scoop commandline-installer.
To install Allure, download and install Scoop and then execute in the Powershell:
scoop install allure
Also Scoop is capable of updating Allure distribution installations. To do so navigate to the Scoop installation directory and execute
\bin\checkver.ps1 allure -u
This will check for newer versions of Allure, and update the manifest file. Then execute
scoop update allure
to install a newer version. (documentation)
allure generate /xxx/xxx -o /xxx/xxx --clean
Usage 用法:
generate [options] The directories with allure results. pytest 报告存放目录
-c, --clean
Clean Allure report directory before generating a new one. 每次生成 allure 报告时清除上一次的报告数据。
Default: fals
-o, --report-dir, --output
The directory to generate Allure report into. allure 报告输出地址。
Default: allure-report