# xatomfarm **Repository Path**: xatom/xatomfarm ## Basic Information - **Project Name**: xatomfarm - **Description**: 单元测试框架 - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-20 - **Last Updated**: 2021-04-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # xatom ## 介绍 基于python3的单元测试框架 参考文章 - https://www.cnblogs.com/yinjia/p/9503408.html - https://blog.csdn.net/songlh1234/article/details/84317617 ## 软件特性 简单 稳定 快速 ## 功能说明 - 接口测试 - html报告 - 邮件发送 - ...... ## 使用说明 ### 文件结构 app/ 基础类 core/ 核心类 config.py 配置 log.py 日志 helper/ 帮助类 helper 帮助类 lib/ 扩展库 testcase/ 测试用例 config/ 配置文件 public/ 入口执行 report/ 测试报告 storage/ 文件存储 data/ 数据文件 logs/ 日志文件 tests/ 单元测试 README.md requirements.txt ### 功能 #### 已完成 [Config](https://docs.python.org/zh-cn/3/library/configparser.html) [Log](https://docs.python.org/zh-cn/3/library/logging.html) [HTMLTestRunner](https://github.com/findyou/HTMLTestRunnerCN/tree/dev) #### 待完成 [mysql] [ddt] [excel] [testcase] [email] [requests] ...... ### 配置 配置文件目录是固定的,支持多个配置文件,直接在config文件夹中添加.ini文件即可 [Config手册](https://docs.python.org/zh-cn/3/library/configparser.html) from core.config import Config c = Config.init() c.get("LOG","level") ### 日志 日志封装比较简单,只提供了基础的 [Log手册](https://docs.python.org/zh-cn/3/library/logging.html) from core.log import Log log l = Log.init() l.debug("i am default info") ### HTMLTestRunner HTMLTestRunner,github上面一个支持python3的项目,存在报错,对核心代码做了一点修改 [HTMLTestRunner](https://github.com/findyou/HTMLTestRunnerCN/tree/dev) with open(report_filename, "wb") as f: runner = HTMLTestRunnerCN.HTMLTestReportCN(stream=f, title='XX接口自动化测试报告',description='环境:mac 浏览器:chrome') runner.run(testcases)