摘要:
用例运行级别 模块级(setup_module/teardown_module)开始于模块始末,全局的 函数级(setup_function/teardown_function)只对函数用例生效(不在类中) 类级(setup_class/teardown_class)只在类中前后运行一次(在类中) 阅读全文
摘要:
pytest 是 python 的一种单元测试框架,与python 自带的 unittest测试框架类似,但是比 unittest 框架使用起来更简洁,效率更高。根据pytest 的官方网站介绍,它具有如下特点: 非常容易上手,入门简单,文档丰富,文档中有很多实例可以参考 能够支持简单的单元测试呾复 阅读全文
摘要:
Python的字符串内建函数这些方法实现了string模块的大部分方法 , 如下表硕士列出了目前字符串内建支持的方法 string = 'XXX' string.capitalize() # 把字符串的第一个字符大写 string.center(width) # 返回一个原字符串居中,并使用空格填充 阅读全文
摘要:
a = '123'a1 = '456'a2 = '789'%占位符 text = "a=%s"%atext1 = "a=%s,a1=%s,a2=%s"%(a, a1, a2)print(text)print(text1).format()方法 text = "a={}".format(a)text1 阅读全文
摘要:
此方法可破解简单的验证码,如: 注:中文识别正在寻找办法 安装: 1、python3 2、Pillow 3、pytesseract 4、tesseract-ocr 下载地址:https://pan.baidu.com/s/1kXIsg1S9CqgSpgzeg9T59Q 安装tesseract-ocr 阅读全文
摘要:
yaml 通常用来存储数据,类似于json 安装:pip install ruamel.yaml 建一个空的yaml文件 写入数据 import osfrom ruamel import yaml# 将字典写入到yamldata = { 'host1': '123', 'host2': 456, ' 阅读全文
摘要:
先注册一个账号,注册地址:https://github.com/ 记住地址 下载git本地客户端,下载地址:https://git-scm.com/download/win 一路next傻瓜安装,加入环境变量 新建一个文件夹,运行cmd,输入git,出现以下内容证明安装成功 1.建仓:git ini 阅读全文
摘要:
1、中文乱码问题: (1)、文件头加上# -*- coding:utf-8 -*- 或者 #coding=utf8 (2)、pymssql.connect连接串中charset是要跟你数据库的编码一样,如果是数据库是gb2312 ,则写charset='gb2312'。 (3)、读取数据时需要dec 阅读全文
摘要:
先点击第一个,再对第二个进行操作,否则操作失败 阅读全文
摘要:
from selenium import webdriverfrom selenium.webdriver.support.wait import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as E 阅读全文