# pytest-bithumb **Repository Path**: zhangjg_git/pytest-bithumb ## Basic Information - **Project Name**: pytest-bithumb - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2019-12-27 - **Last Updated**: 2021-07-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # bithumb-chain-test #### 项目依赖 - pip3 freeze > requirements.txt - 导出项目依赖 - pip3 install -r requirements.txt - 安装项目依赖 #### 虚拟环境 - 安装 - pip3 install virtualenv - 创建虚拟环境,进入当前项目路径 - virtualenv --no-site-packages venv - 进入虚拟环境,激活 - source venv/bin/activate - 在虚拟环境内安装该项目需要的第三方库 - pip3 install django==2.1 - 退出 - deactivate - 修改项目关联虚拟环境 #### 用例命名规则 - 测试类 Test 开头 - 测试函数 test_module_method_normal_key ```text 测试函数说明 test --> 适配 Pytest 规则,不可忽略 module --> 当前测试类归属的模块/合约,当前类下面的所有函数最好统一,方便日志归类输出到文件件, 不可忽略 method --> 需要测试的abi/api ,可忽略 normal --> mark tag 运行时 指定normal / abnormal, 可忽略 key --> 某个关键字的表示 可忽略 ``` #### 测试入口 - 按标记分层执行用例, 不区分模块 - normal ```text python3 main.py normal // 仅执行 已 `test_` 开头并标记有 @pytest.mark.normal的用例 ``` - abnormal ```text python3 main.py abnormal // 仅执行 已 `test_` 开头并标记有 @pytest.mark.abnormal的用例 ``` ```text 另本地调试时,可标记为debug执行 ``` - 按模块执行 - tag ```text python3 main.py tag // 执行所有的tag用例(test_main/tag 目录下的所有已`test_`开头的测试用例) python3 main.py name_service // 执行所有的name_service用例(test_main/tag 目录下的所有已`test_`开头的测试用例) ... ``` #### 报告输出 - 目录 (./allure/) 拼接日期 - html // 用例运行完成后自动生成html报告,可用浏览器打开 index.html - logs // 测试产生的日志,以测试类命名文件夹,以用例名称命名.log日志文件 - result // 测试过程中收集的测试结果 #### linux 部署 - 部署环境 ```text linux ubuntu 16.04 1. 升级python3.5 -> python3.6 https://blog.csdn.net/qq_40965177/article/details/83500817 https://blog.csdn.net/Zrazier/article/details/98472501 https://blog.csdn.net/study_in/article/details/94385020 error: x86_64-linux-gnu-gcc apt-get install python3.6-dev 2. 安装jenkins(不使用docker,更新bithumb需要删掉所有镜像) https://www.jianshu.com/p/845f267aec52 apt-get install jenkins=2.138.1 --fix-missing 3. 安装allure(linux) apt-get install software-properties-common python-software-properties No module named 'lsb_release' after install Python 3.6.3 from source https://askubuntu.com/questions/965043/no-module-named-lsb-release-after-install-python-3-6-3-from-source https://www.jianshu.com/p/8a880a175fd6 ```