摘要: 查看帮忙信息 F:\PycharmProjects\djangotest>pytest --h 查看版本号 F:\PycharmProjects\djangotest>pytest --version F:\PycharmProjects\djangotest>pytest -V 查看mark相关功 阅读全文
posted @ 2023-03-19 19:47 七亿星空 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 1、备份test数据库: mysqldump -uroot -p1234 test>/tmp/backup.sql 2、备份user表:mysqldump -uroot -p1234 tetst user>table.sql 3、恢复数据库:mysql -uroot -p1234 test</tmp 阅读全文
posted @ 2021-08-30 22:36 七亿星空 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 使用方法 @pytest.mark.name_of_the_mark,其中name_of_the_mark是自定义标记的名字,举个例子,下面定义了3个,对方法、函数都可以进行标记 # @File : test_001.py import pytest @pytest.mark.testa class 阅读全文
posted @ 2021-05-19 13:20 七亿星空 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 一个参数a,依次传入值1,2,3,用列表传值 import pytest @pytest.mark.parametrize('a',[1,2,3]) def testauto(a): assert a==3 两个参数a,b,用元祖传值 import pytest @pytest.mark.param 阅读全文
posted @ 2021-05-13 16:39 七亿星空 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 使用pytest框架前需要安装两个库 pip install pytest pip install pytest-html 原生态报告 (可执行pytest test_case.py -s --html=report.html 就会在代码同级目录下生成report.html报告,其中-s是把打印的内 阅读全文
posted @ 2021-05-13 15:21 七亿星空 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1、像卸载一般电脑程序一样,把老的Python 3.6.2版本卸载,会自动删除之前配置的环境变量信息 2、官网下载最新的python版本,安装的时候记得勾选Add Python 3.9.5 to PATH就行,会自动添加环境变量 3、pycharm解释器也需要更新下设置,否则执行程序就会报下面的粉红 阅读全文
posted @ 2021-05-12 19:40 七亿星空 阅读(2509) 评论(0) 推荐(0) 编辑
摘要: import hashlib mpsw=hashlib.md5(b'123456').hexdigest()#给123456加密,转为16进制 print(mpsw) #e10adc3949ba59abbe56e057f20f883e 阅读全文
posted @ 2021-05-12 17:04 七亿星空 阅读(459) 评论(0) 推荐(0) 编辑
摘要: 1、登录模块 import requests def test_login(username,password): host='http://localhost' url=f'{host}/api/bbb/ccc' payload={'username':username, 'password':p 阅读全文
posted @ 2021-05-11 22:07 七亿星空 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1、安装requests库:pip install requests # -*- coding: utf-8 -*- import requests Host='http://localhost' api_url=f'{Host}/api/bbb/ccccc/' # header='Content- 阅读全文
posted @ 2021-05-11 17:40 七亿星空 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 需要导入Select包 from selenium.webdriver.support.select import Select # 定位到下拉框元素ele = driver.find_element_by_name("type")# 根据 value 属性选择Select(ele).select_ 阅读全文
posted @ 2021-03-13 21:07 七亿星空 阅读(95) 评论(0) 推荐(0) 编辑