Skip to main content
 首页 » 编程设计

python之启用正在记录的 pysys 测试

2024年10月24日13JeffreyZhao

我目前正在尝试建立一些基于 pysys 框架的自动化测试。

测试运行良好,我还根据项目文件中显示的示例添加了 JUnitXMLResultsWriter。 但是由于某种原因没有激活录音。

我在 BaseRunner 中找到了变量记录,当直接设置为 True 时,它​​会按预期工作,但这不是本意。

因此我的问题是应该设置什么才能激活我的测试用例记录?

亲切的问候斯特凡

请您参考如下方法:

您可以使用 -r 选项从 pysys.py 运行启动器启用记录,即“pysys.py run -r”。然后,这将根据 .pysysproject 文件中配置的结果编写器记录输出。有关选项的完整列表,请使用运行目标上 pysys.py 启动程序的 -h 选项,即

C:\dev>pysys.py run -h 
 
PySys System Test Framework (version 0.9.2): Console run test helper 
 
Usage: pysys.py run [option]* [tests]* 
   where [option] includes; 
       -h | --help                 print this message 
       -r | --record               record the test results in the working directory 
       -p | --purge                purge the output subdirectory on test pass 
       -v | --verbosity STRING     set the verbosity level (CRIT, WARN, INFO, DEBUG) 
       -a | --type      STRING     set the test type to run (auto or manual, default is both) 
       -t | --trace     STRING     set the requirement id for the test run 
       -i | --include   STRING     set the test groups to include (can be specified multiple times) 
       -e | --exclude   STRING     set the test groups to exclude (can be specified multiple times) 
       -c | --cycle     INT        set the the number of cycles to run the tests 
       -o | --outdir    STRING     set the name of the test output subdirectory 
       -m | --mode      STRING     set the user defined mode to run the tests 
       -n | --threads   INT        set the number of worker threads to run the tests (defaults to 1). 
                                   A value of 0 sets to the number of available CPUs 
       -X               KEY=VALUE  set user defined options to be passed through to the test and 
                                   runner classes. The left hand side string is the data attribute 
                                   to set, the right hand side string the value (True of not specified)