当前位置:网站首页>Pytest series-01-installation and introduction
Pytest series-01-installation and introduction
2022-07-16 07:35:00 【Jack_ Chen3】
Installation and introduction
Python Supported version :Python 2.7,3.3, 3.7
Support platform :Unix/MacOS and Windows
install :pip install pytest
Check if the installation is successful :
pytest --version
This is pytest version 3.7.0, imported from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pytest.py
Create a simple test :
def sum(a):
return x+1
def test_answer():
assert sum(4)==5
When executing the script : You need to define the file name of the script as test_XXXX.py, And then the command line cd Go to the directory where the script is located , Direct execution :pytest.
Execute multiple test scripts
The upper side is executing pytest when , In fact, it will execute all operations under the current directory and its subdirectories with test_XXX.py as well as XXX_test.py File format . He will look for relevant test Method to execute .
边栏推荐
- 30岁转行软件测试靠谱吗?一个过来人的心路历程送给迷茫的你
- Flink on Yan ha mode construction problem
- 【LeetCode】1252. 奇数值单元格的数目
- SAP logon cannot start normally
- ScheduledThreadPoolExecutor源码和误区详解
- 【LeetCode】2028. 找出缺失的观测数据
- Semaphore, countdownlatch use and talking about the source code
- SAP ABAP BAPI_ ACC_ DOCUMENT_ Post create accounting voucher
- 无重叠区间
- 2021-11-7bugku做题记录25——POST
猜你喜欢

2021/12/12 攻防世界 crypto做题记录

Leetcode lecture - 1 Sum of two numbers (difficulty: simple)

Type erase & bridge method

6、 Configuration experiment report of data backup software

Minimum cycle section in KMP

ScheduledThreadPoolExecutor源码和误区详解

Men should be "strong", not "soft", "weak" and "empty"

从功能测试到自动化测试,实现薪资翻倍,我整理的超全学习指南【附学习笔记】
![[sword finger offer] special summary of linked list](/img/5d/7b951a75caf8818cb1191f83b7fa94.png)
[sword finger offer] special summary of linked list

Week4
随机推荐
【LeetCode】307. Area and retrieval - array modifiable
[sword finger offer] special summary of linked list
User module development
MySQL - data page
【LeetCode】796. 旋转字符串
New features of es6-es11 (this article is enough)
【LeetCode】1217. 玩筹码
Jenkins中设置展示Allure报告小结
五、Microsoft群集服务(MSCS)环境的搭建实验报告
Minimum cycle section in KMP
mysql学习记录
select / poll / epoll 讲解
刚接手的新产品怎么快速展开测试
Chrome realizes automated testing: recording and playback web page actions
Mvcc multi version concurrency control
都说软件测试工资高,那么软件测试如何才能月薪过10k呢..
MySQL lock mechanism
Unity3d transform component
字节测试总监熬夜10天肝出来的测试岗面试秘籍,给你的大厂梦插上翅膀~
Bucket sorting + drawer principle