当前位置:网站首页>pycharm专业版 配置pytest
pycharm专业版 配置pytest
2022-07-30 05:38:00 【gsxdcyy】
前言
我是使用python的一个轻量框架flask,如果有跟我一样是用flask的xd不知道怎么测试的话,强烈建议flask官方文档,不用到处找教程了,看一看官方文档,就知道怎么搞了
配置
我用的是pycharm专业版,默认的测试模块是unittests,所以我们在设置里面修改一下,参考这个文章
点击那个扳手的图标,或者右上角运行图标旁边的,编辑配置都可以,然后在additional arguments这里添加想要添加的参数
我最后的配置是--html=report.html --self-contained-html--cov=C:/Users/cgy/Desktop/NewWaiMai --cov-report=html
第一个是pytest-html插件,这个会生成一个html报告,–self-contained-html是让他只生成一个html文件
第二个是pytest-cov,是测定覆盖率的插件,也会生成报告,但是是一个文件夹,里面的index.html就是覆盖率的报告了
这是两个插件相关的的文章
pytest-html
pytest-cov
pytest-html的报告没有allure的好看,所以可以下载allurepip install allure-pytest
然后命令行添加--alluredir, results
然后测试运行结束后,输入allure generate results -o reports
这里的results是存放测试生成的json文件的文件夹,reports是生成html报告的文件夹
边栏推荐
- ClickHouse 数据插入、更新与删除操作 SQL
- 微积分 / 自动求导
- 4、nerf(pytorch)
- 子查询作为检索表时的不同使用场景以及是否需要添加别名的问题
- SOA(面向服务架构)是什么?
- 【Koltin Flow(二)】Flow操作符之末端操作符
- Learn FPGA from the underlying structure (6) ---- Distributed RAM (DRAM, Distributed RAM)
- PyCharm usage tutorial (more detailed, picture + text)
- CISP-PTE真题演示
- G巴士计数(Google Kickstart2014 Round D Problem B)(DAY 89)
猜你喜欢

How is crawler data collected and organized?

使用DataEase开源工具制作一个高质量的数据大屏

pytorch中的线性代数

报错:npm ERR code EPERM

This dependency was not found:

Learn FPGA from the underlying structure (6) ---- Distributed RAM (DRAM, Distributed RAM)

St. Regis Takeaway Project: New dishes and dishes paged query

mysql高阶语句(一)

ezTrack-master使用教程

SOA(面向服务架构)是什么?
随机推荐
np.where()用法
MySQL(4)
Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案
微信小程序开发学习
[GLib] What is GType
成绩排序(华中科技大学考研机试题)(DAY 87)
个人博客系统(附源码)
net start mysql MySQL 服务正在启动 . MySQL 服务无法启动。 服务没有报告任何错误。
“tensorflow.keras.preprocessing“ has no attribute “image_dataset_from_directory“
839. Simulated heap
MySql模糊查询大全
"Hou Lang" programmer version, a speech dedicated to a new generation of programmers, He Bing's "Hou Lang" speech imitation show
[Mysql] DATEDIFF函数
Redis学习
爬虫数据是如何收集和整理的?
CISP-PTE真题演示
Thymeleaf简介
cnpm installation steps
Basic syntax of MySQL DDL and DML and DQL
pytorch中的线性代数