当前位置:网站首页>unittest. Texttestrunner does not generate TXT test reports
unittest. Texttestrunner does not generate TXT test reports
2022-07-02 06:33:00 【bthtth】
suite = unittest.TestSuite()
loader = unittest.TestLoader()
suite.addTest(loader.loadTestsFromTestCase(CasesLogin))
with open('result_unittest.txt', 'w+', encoding='utf-8') as file:
runner = unittest.TextTestRunner(file, descriptions="asdf", verbosity=2)
runner.run(suite)
The code snippet is as above .
Problem description : Use case execution succeeded ,pycharm The project column of does not generate result_unittest.txt file . Try creating it manually , Re execution , After the implementation passed , File is still empty
resolvent :
1\ stay pycharm of use unittest Frame operation , Cannot generate test report . Should use the python function . Refer to the post
2\ This setting is still not enough . But I found that from " My documents " Access the report path in , Test file generated , And the test results are recorded . So I found the following method :
Check whether the status of the current project is " Ruled out "Exclude.
file -setting
project structure - project - excluded - Cancel - determine
边栏推荐
猜你喜欢
随机推荐
Data science [viii]: SVD (I)
ShardingSphere-JDBC篇
Redis---1.数据结构特点与操作
AWD学习
Thread hierarchy in CUDA
CUDA中的动态全局内存分配和操作
Selenium+msedgedriver+edge browser installation driver pit
代码技巧——Controller参数注解@RequestParam
MySQL的10大經典錯誤
The intern left a big hole when he ran away and made two online problems, which made me miserable
CUDA中的Warp Shuffle
It is said that Kwai will pay for the Tiktok super fast version of the video? How can you miss this opportunity to collect wool?
Sublime Text 配置php编译环境
CUDA中的异步数据拷贝
PgSQL学习笔记
自学table au
压力测试修改解决方案
20210306转载如何使TextEdit有背景图片
Functions of tensorrt
Warp shuffle in CUDA