当前位置:网站首页>Pytest assert encapsulation
Pytest assert encapsulation
2022-06-25 21:19:00 【Strange meow】
because pytest Self contained assert When the assertion fails , The actual and expected results of the failure will not be printed , Bring invariance to the view , So it is necessary to package, format and print
import logging import pytest from common.baselogger import logger def assert_equal(actual, expected): assert actual == expected, " The actual result is :{0}, The expected result is :{1}".format(actual, expected) def assert_not_equal(a, b): assert a != b, "{0} be equal to {1}".format(a, b) def assert_in(a, b): assert a in b, "{0} It doesn't contain {1}".format(b, a) def assert_true(value): assert value, "{0} For false ".format(value)
边栏推荐
- Lesson 3 urllib
- C language dynamic memory allocation
- Write a "standard" macro min, which inputs two parameters and returns the smaller one
- Support JPEG format in GD Library in php7.4
- Yolov4 reading notes (with mind map)! YOLOv4: Optimal Speed and Accuracy of Object Detection
- 炒股票用指南针安全还是用证券软件安全?哪里可以开户怎么开
- Section 13: simplify your code with Lombok
- ZABBIX foundation details
- Yunzhisheng atlas supercomputing platform: computing acceleration practice based on fluid + alluxio (Part 2)
- CANoe. Diva operation guide TP layer test
猜你喜欢
Yunzhisheng atlas supercomputing platform: computing acceleration practice based on fluid + alluxio (Part 2)
Sqlmap for interface security testing
Insert and update each database
Explain memcached principle in detail
1.1-mq visual client preliminary practice
Online yaml to XML tool
Tencent music knowledge map search practice
Free your hands and automatically brush Tiktok
The difference between strcpy and memcpy
04 disk space management
随机推荐
Is Galaxy Securities reliable? Is it safe to open a securities account?
Virtualenvwrapper solves the installation error, and virtualenvwrapper is permanently effective
js(3)
Lesson 1 Preparation
Support JPEG format in GD Library in php7.4
Is it legal to open an account for flush stock trading software? Is it safe?
Mutual conversion of CString and char*
How to buy the millions of medical insurance for children? How much is it a year? Which product is the best?
What is an app circle of friends advertisement
Soft test intermediate simple notes
Insert and update each database
Is it safe to open an account with qiniu securities?
Code program related problems troubleshooting directory
Working principle and experimental analysis of DHCP
[nail scenario capability package] hospital visitor verification
[nailing scenario capability package] company / Park Digital canteen
Decryption of APP parameters of a cross-border export e-commerce - dunhuang.com
Illustration tcp/ip - Chapter 1 and 2 Notes
Idea implements hot deployment
Cvpr2020 | the latest cvpr2020 papers are the first to see, with all download links attached!