随笔分类 -  python+unittest框架内方法

unittest框架扩展方法
摘要:import calendar #数字转为月份简写 date_list = [1,2,3,4,5,6,7,8,9,10,11,12] for i in date_list: print(calendar.month_abbr[i]) date_list = [1,2,3,4,5,6,7,8,9,10 阅读全文
posted @ 2022-09-28 16:18 究极不吃香菜 阅读(325) 评论(0) 推荐(0) 编辑
摘要:如果要在报告中加入每一个测试用例执行的logging信息,则需要改HTMLTestRunner的源码 1、初始化定义logging信息, class _TestResult(TestResult): # note: _TestResult is a pure representation of re 阅读全文
posted @ 2022-03-08 15:50 究极不吃香菜 阅读(104) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/python3 # -*- coding: utf-8 -*- #coding=utf-8 import os """ A TestRunner for use with the Python unit testing framework. It generates a HTM 阅读全文
posted @ 2022-03-08 12:22 究极不吃香菜 阅读(144) 评论(0) 推荐(0) 编辑
摘要:python 生成日志文件及写入 def log_ging(): level = logging.DEBUG filename = 'test_log_' log_path = os.path.dirname(os.getcwd()) + '/baidu/baidu_logs/'#父目录路径 dat 阅读全文
posted @ 2022-03-07 18:28 究极不吃香菜 阅读(65) 评论(0) 推荐(0) 编辑
摘要:##测试数据 表格数据转化为字典提供测试脚本使用, import sys,os from openpyxl import load_workbook add_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys. 阅读全文
posted @ 2022-03-02 17:46 究极不吃香菜 阅读(163) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示