Pycharm退出pytest模式(run pytest in模式)

一、首先,我们来看一下pycharm进入test模式与run模式的区别:

run模式:

Pycharm之pytest模式(run pytest in xxx 模式)【注意与run模式的区分(run xxx)】

 test模式:

Pycharm之pytest模式(run pytest in xxx 模式)【注意与run模式的区分(run xxx)】

很明显的问题,运行模式不同的情况下,对于测试执行结果的显示有很大的不同。

当我们使用pytest框架编写自动化测试脚本并且对其调试的过程中,我们一般为了更好的显示是将运行模式设置为pytest运行模式。

二、pycharm中修改运行模式

1.依次点击工具栏中的【File——》Tools——》Python Integrated Tools】

Pycharm之pytest模式(run pytest in xxx 模式)【注意与run模式的区分(run xxx)】

2.在【Testing】栏位中选择默认测试运行程序【或者称为默认测试运行器】为pytest,然后点击Apply应用之后点击OK

Pycharm之pytest模式(run pytest in xxx 模式)【注意与run模式的区分(run xxx)】

 注意:pytest是可以兼容unittest脚本的,之前写的unittest用例也能用pytest框架去运行

相关文章:

  • 2021-09-23
  • 2021-12-28
  • 2021-09-03
  • 2021-12-30
  • 2022-01-17
  • 2022-12-23
  • 2021-01-06
  • 2021-09-21
猜你喜欢
  • 2022-01-07
  • 2021-07-20
  • 2021-04-11
  • 2021-06-28
  • 2021-05-29
  • 2021-08-15
  • 2021-07-13
相关资源
相似解决方案