【一】

今天更新了一波pytest,4.50 -> 6.2.3。执行了一波测试发现之前的logging输出不见了。

看了下启动参数 --log-cli-level=LOG_CLI_LEVEL

加了一下下,可以了

现在启动参数是

pytest.main(['-v', '-s', os.path.join(BASE_DIR, r'test_case/'), '--alluredir', './report/', '--log-cli-level=INFO'])

【二】

如果使用的是pytest-html输出测试报告,show details时,出现No log output captured.情况,可以在启动参数加'--capture=sys'。

pytest.main(
['-v', '-s', os.path.join(BASE_DIR, r'test_case/test_notification/test_1.py'), '--html',
'./report/report.html', '--capture=sys', '--log-cli-level=INFO', '--disable-warnings'])

【pytest】执行测试不输出logging日志问题的更多相关文章

  1. unittest 执行测试脚本输出测试报告

    import unittestimport HTMLTestRunnertest as HTMLTestRunner#获取路径path = './'#创建测试套件,读取测试脚本suite = unit ...

  2. bash执行命令分别输出正常日志和错误日志

    0. 说明 执行bash命令的定时任务时候,希望能把正常的日志输出到一个文件里面,同时如果执行的过程发生异常则把异常日志输出到另一个不同的文件中.方便今后异常排查,极大有利于快速定位出错位置. 需要了 ...

  3. Robot Framework源码解析(2) - 执行测试的入口点

    我们再来看 src/robot/run.py 的工作原理.摘录部分代码: from robot.conf import RobotSettings from robot.model import Mo ...

  4. python基础语法13 内置模块 subprocess,re模块,logging日志记录模块,防止导入模块时自动执行测试功能,包的理论

    subprocess模块: - 可以通过python代码给操作系统终端发送命令, 并且可以返回结果. sub: 子    process: 进程 import subprocess while Tru ...

  5. Pytest命令行执行测试

    Pytest命令行执行测试 from collections import namedtuple Task = namedtuple('Task', ['summary','owner','done' ...

  6. Python日志输出——logging模块

    Python日志输出——logging模块 标签: loggingpythonimportmodulelog4j 2012-03-06 00:18 31605人阅读 评论(8) 收藏 举报 分类: P ...

  7. Linux命令执行的屏幕输出内容重定向到日志文件

    摘要: 作者:Syn良子 出处:http://www.cnblogs.com/cssdongl 转载请注明出处 快速mark一下这个命令细节,免得以后使用又忘记了 大家都知道可以用echo来输出内容到 ...

  8. python 自动化之路 logging日志模块

    logging 日志模块 http://python.usyiyi.cn/python_278/library/logging.html 中文官方http://blog.csdn.net/zyz511 ...

  9. python模块分析之logging日志(四)

    前言 python的logging模块是用来设置日志的,是python的标准模块. 系列文章 python模块分析之random(一) python模块分析之hashlib加密(二) python模块 ...

  10. Python常用库 - logging日志库

    logging的简单介绍 用作记录日志,默认分为六种日志级别(括号为级别对应的数值) NOTSET(0) DEBUG(10) INFO(20) WARNING(30) ERROR(40) CRITIC ...

随机推荐

  1. (1028) 权限,chmod、chgrp、chown详解

    https://www.cnblogs.com/Berryxiong/p/6193866.html 例1: $ chgrp - R book /opt/local /book 改变/opt/local ...

  2. 一些sql查询的case

    1.单列去重,输出去重后条目数量 select count(distinct(`id`)) from student; 2.根据分数段统计数据条目:利用case when selectcount(ca ...

  3. Codeforces 1208F Bits And Pieces

    题目描述 You are given an array a of n integers. You need to find the maximum value of ai|(aj&ak) ov ...

  4. QMap 删除指针内容时的一个问题

    在测试代码时,发现一个问题: void UserManager::removeUser(const QString &name) { QMap<QString, User*>::I ...

  5. js扩展符号

    扩展数组:const arr23 = ['a', 'b', 'c']; console.log(...arr23); a b c扩展字符串: abc = 'abcdefghi'; console.lo ...

  6. Redis缓存雪崩,击穿和穿透

    这三个问题的发生,会导致大量的请求直接积压到数据库,如果并发量很大,则可能会导致数据库宕机或故障. 缓存雪崩   描述:大量的请求无法在redis缓存中进行处理而被发送到数据库,导致数据库压力陡增. ...

  7. lua-1-c# 执行lua文件-调用lua文件中的方法

    using UnityEngine;using System.Collections;using LuaInterface;//引入lua接口public class MyHellowWorld : ...

  8. J V M(三)沙箱安全机制

    沙箱安全机制 Java安全模型的核心就是Java沙箱(sandbox)什么是沙箱? 沙箱是一个限制程序运行的环境.沙箱机制就是将Java代码限定在虚拟机(JVM)特定的运行范围中,并且严格限制代码对本 ...

  9. TP5--页面跳转

    //模拟登录 // $admin = 0; // if($admin != 10){ // //页面跳转 // $this->success('登录失败','login/index'); // ...

  10. 1071 - Specified key was too long; max key length is 767 bytes

    set global innodb_large_prefix=on;set global innodb_file_format=BARRACUDA; 主从都要修改以上2个参数.