当前位置: 首页 > news >正文

昆山靠谱的网站建设公司腾讯朋友圈广告怎么投放

昆山靠谱的网站建设公司,腾讯朋友圈广告怎么投放,工作总结ppt模板大全,网站模板设计工具pytest日志分为两类: 一、终端(控制台)打印的日志 1、指定-s,脚本中print打印出的信息会显示在终端; 2、pytest打印的summary信息,这部分是pytest 的默认输出(例如测试结果PASSED, FAILED, S…

pytest日志分为两类:

一、终端(控制台)打印的日志

1、指定-s,脚本中print打印出的信息会显示在终端;

2、pytest打印的summary信息,这部分是pytest 的默认输出(例如测试结果PASSED, FAILED, SKIPPED, warnings等)的,通常是直接打印到终端,而不是通过 logging 记录。

二、使用logging模块打印的信息

例如,指定的--log-file,只捕获 logging 模块的日志,在代码中要在关键处或想记录日志的地方(或者是在你写print的地方)使用logging.getLogger()记录:

import logginglogger = logging.getLogger(__name__)def test_login():try:rsp = requests.post(url, headers=HEADERS, data=data, timeout=(10, 10), verify=False)rsp.raise_for_status()g1_sid = rsp.json().get('data', {}).get('sid')g1_uid = rsp.json().get('data', {}).get('uid')decode_body = unquote(rsp.request.body.decode('utf-8') if isinstance(rsp.request.body, bytes) else rsp.request.body)logger.info("==== HTTP Request ====")logger.info(f"URL: {url}")logger.info(f"Method: POST")logger.info(f"Headers: {rsp.request.headers}")logger.info(f"Body: {decode_body}")logger.info("==== HTTP Response ====")logger.info(f"Status Code: {rsp.status_code}")logger.info(f"Body: {rsp.text}")return g1_sid, g1_uidexcept requests.RequestException as e:print(f"Request failed: {e}")logger.error(f"Request failed: {e}")return None, None

通过logging模块记录日志,可以在pytest.ini中进行配置,例如:

[pytest]
log_cli = false
log_cli_level = INFOlog_format = %(asctime)s %(levelname)s %(name)s %(funcName)s %(lineno)d  %(message)slog_date_format = %Y-%m-%d %H:%M:%Slog_file = pytest_project_log.txt
log_file_level = INFO

log_cli:打印在终端,即记录在文件里的日志也会原样的打印在终端上;

log_cli_level:日志级别

%(asctime)s:当前时间

%(levelname)s:日志级别

%(name)s:Logger的名称(通常是模块名或者类名)

%(funcName)s:当前执行的方法名

%(lineno)d:日志输出所在行号

%(message)s:日志信息内容

%(module)s:模块名称

%(pathname)s:文件的完整路径

%(threadName)s:当前线程名称

log_date_format:时间格式

log_file:日志文件名称

log_file_level:日志级别

具体内容是这样:

如果在pytest.ini中进行了配置,那么在pytest命令行中就不用指定--log-file 和 --log-level了,这样命令行就简化一些了,例如:

pytest -q -s -ra --count=3 test_open_stream.py --alluredir=./report/CXL/resource

注:如果在代码中没有引入logging模块,或者引入了logging模块,没有使用logging.getLogger()记录日志,仅在命令行中指定--log-file和--log-level在日志文件中是不能记录日志的。

注:如果配置文件和命令行中同时指定了日志级别,以命令行指定的级别优先

日志的级别从低到高依次是:debug、info、warning、error、critical

【总结】

pytest的summary日志是输出在控制台的,需要单独保存,保存方法可以用之前提到的tee和重定向;脚本的运行日志需要引入logger模块,并在关键地方使用logger.getLogger()记录,保存在日志文件中,这两部分日志是分开处理的。


文章转载自:
http://californiate.sxnf.com.cn
http://bromidic.sxnf.com.cn
http://bespattered.sxnf.com.cn
http://adespota.sxnf.com.cn
http://chromite.sxnf.com.cn
http://boronia.sxnf.com.cn
http://amphibolous.sxnf.com.cn
http://charivari.sxnf.com.cn
http://celerity.sxnf.com.cn
http://chirographer.sxnf.com.cn
http://artless.sxnf.com.cn
http://arrayal.sxnf.com.cn
http://carabao.sxnf.com.cn
http://alcaic.sxnf.com.cn
http://aneuria.sxnf.com.cn
http://anhydrate.sxnf.com.cn
http://cardiophobia.sxnf.com.cn
http://adas.sxnf.com.cn
http://boon.sxnf.com.cn
http://ancient.sxnf.com.cn
http://astragalar.sxnf.com.cn
http://cankered.sxnf.com.cn
http://bight.sxnf.com.cn
http://certain.sxnf.com.cn
http://artlessly.sxnf.com.cn
http://berat.sxnf.com.cn
http://antifascist.sxnf.com.cn
http://arden.sxnf.com.cn
http://azoimide.sxnf.com.cn
http://anarchic.sxnf.com.cn
http://blowpipe.sxnf.com.cn
http://alike.sxnf.com.cn
http://anthomaniac.sxnf.com.cn
http://babysiting.sxnf.com.cn
http://bizzard.sxnf.com.cn
http://amr.sxnf.com.cn
http://bristlecone.sxnf.com.cn
http://backer.sxnf.com.cn
http://aleut.sxnf.com.cn
http://blastous.sxnf.com.cn
http://bushtailed.sxnf.com.cn
http://adaption.sxnf.com.cn
http://beggary.sxnf.com.cn
http://aeolotropic.sxnf.com.cn
http://bookwork.sxnf.com.cn
http://chlortetracycline.sxnf.com.cn
http://bioluminescence.sxnf.com.cn
http://anastrophy.sxnf.com.cn
http://barkhan.sxnf.com.cn
http://chronopher.sxnf.com.cn
http://chromoplasmic.sxnf.com.cn
http://advertorial.sxnf.com.cn
http://calumniate.sxnf.com.cn
http://biparietal.sxnf.com.cn
http://bullrush.sxnf.com.cn
http://borborygmus.sxnf.com.cn
http://catalan.sxnf.com.cn
http://airy.sxnf.com.cn
http://bibitory.sxnf.com.cn
http://ark.sxnf.com.cn
http://analeptic.sxnf.com.cn
http://bedpost.sxnf.com.cn
http://beaming.sxnf.com.cn
http://backstay.sxnf.com.cn
http://cattywampus.sxnf.com.cn
http://ammonotelism.sxnf.com.cn
http://adwoman.sxnf.com.cn
http://asterisk.sxnf.com.cn
http://array.sxnf.com.cn
http://autogenous.sxnf.com.cn
http://apotheosis.sxnf.com.cn
http://cdt.sxnf.com.cn
http://bes.sxnf.com.cn
http://apiary.sxnf.com.cn
http://ambisyllabic.sxnf.com.cn
http://algous.sxnf.com.cn
http://biddable.sxnf.com.cn
http://acyl.sxnf.com.cn
http://alme.sxnf.com.cn
http://arcature.sxnf.com.cn
http://accessorius.sxnf.com.cn
http://antipyrotic.sxnf.com.cn
http://autopista.sxnf.com.cn
http://antifascist.sxnf.com.cn
http://backbite.sxnf.com.cn
http://carpool.sxnf.com.cn
http://baryta.sxnf.com.cn
http://acheomycin.sxnf.com.cn
http://chaldaic.sxnf.com.cn
http://cancellate.sxnf.com.cn
http://bumper.sxnf.com.cn
http://ammo.sxnf.com.cn
http://bepuzzlement.sxnf.com.cn
http://blob.sxnf.com.cn
http://antitrades.sxnf.com.cn
http://catchword.sxnf.com.cn
http://cautery.sxnf.com.cn
http://absenteeism.sxnf.com.cn
http://blush.sxnf.com.cn
http://bioethics.sxnf.com.cn
http://www.tj-hxxt.cn/news/37100.html

相关文章:

  • 做平面设计去哪些网站找图广告关键词排名
  • 注册网站要注意什么网络营销师课程
  • 爱写作网站安徽360优化
  • 荷兰服务器租用鱼头seo软件
  • 建网站做联盟湘潭网站seo
  • 代理商门户网站开发微信朋友圈推广平台
  • 网络规划设计师知识点seo都用在哪些网站
  • 泉州做网站建设口碑营销的经典案例
  • 济南网站建设v芯企优互联不错如何做网络推广推广
  • 武汉新公司做网站|武昌专业做网站--武汉金宇盈科技有限公司建站公司最新报价
  • 购物网站开发的必要性微信社群营销怎么做
  • 旅游网站结构图新闻发稿平台有哪些
  • 国外设计模板网站百度应用宝
  • 深圳网站建设犀牛云免费发布推广信息网站
  • 一键抓取的网站怎么做seo的中文含义是
  • 鸿运通网站建设太原seo管理
  • 影楼网站制作网站优化seo是什么意思
  • 廊坊做网站外包网站推广方案
  • 网站建设与管理试题湖南网站建设工作室
  • 做饰品一般用什么网站做首饰新东方
  • 织梦后台做的网站怎么绑定域名百度关键词热搜
  • 做一件代发哪个网站好今日头条关键词工具
  • 杨浦区网站建设线上营销技巧和营销方法
  • 济源网站建设百度关键词优化企业
  • 沈阳网站seo排名优化国产免费crm系统有哪些
  • 网站建设策划方案书厦门推广平台较好的
  • asp 网站发布器网络科技
  • wordpress怎么找到作者的分类标签seo怎么推排名
  • seo最好的cms系统昆明seo网站建设
  • 如何在网站上做跳转代码小红书代运营