def checks(test_dir, path): csvs = Words(test_dir, path) # 模块名 module = csvs.title() allure.dynamic.feature(module) # # 测试类型 test_type = csvs.type() allure.dynamic.story(test_type) # # 用例标题 case_title = csvs.case_title() allure.dynamic.title(case_title) # 检查点 content = csvs.check_txt() check = csvs.word_csv_api() assert int(content) == check 以上这个函数,为什么在我用ptrhon生成allure测试报告的时候,Behaviors中用例里不同的模块名、功能点和标题名称都会重复出现
时间: 2023-12-10 15:41:20 浏览: 36
根据你提供的代码,我认为可能是因为在使用 `allure.dynamic` 注解时,每次调用函数都会生成新的注解,而不会覆盖上一次的注解。所以在生成测试报告时,会出现重复的模块名、功能点和标题名称。
你可以尝试在调用 `allure.dynamic` 注解前,先清除之前的注解,例如:
```
allure.dynamic.feature("")
allure.dynamic.story("")
allure.dynamic.title("")
```
这样可以保证每次调用函数时,注解都是新的,不会重复出现。
相关问题
if not os.path.exists(cfg.model_dir):
This code checks if a directory named "model_dir" exists in the current working directory.
If the directory does not exist, then the code inside the if-statement will be executed.
if not os.path.exists(model_dir): os.makedirs(model_dir)
This code checks if a directory with the name specified in the variable "model_dir" exists in the current directory. If it does not exist, it creates a new directory with that name using the "os.makedirs()" function.
In other words, this code creates a new directory if it doesn't already exist, to store some sort of model-related files or data.
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)