当前位置: 首页 > news >正文

西宁做网站的公司捌君博力请平面设计作品集欣赏

西宁做网站的公司捌君博力请,平面设计作品集欣赏,做一个网站加优化排名得多少钱,找个网站怎么这么难1 TestCase 一个TestCase的实例就是一个测试用例。什么是测试用例呢#xff1f;就是一个完整的测试流程#xff0c; 包括测试环境的准备(setUp)#xff0c;执行测试代码(run)#xff0c;以及测试后环境的还原#xff08;tearDown#xff09;。单元 测试#xff08;unit … 1 TestCase 一个TestCase的实例就是一个测试用例。什么是测试用例呢就是一个完整的测试流程 包括测试环境的准备(setUp)执行测试代码(run)以及测试后环境的还原tearDown。单元 测试unit test的本质也就在这里一个测试用例是一个完整的测试单元通过运行这个测试单元可以对某一个问题进行验证。 2 TestSuite 而多个测试用例集合在一起就是TestSuite,而且TestSuite也可以嵌套TestSuite。TestLoader是用来加载测试用例到TestSuite中的。 3 TextTestRunner TextTestRunner是用来执行测试用例的其中的run()会执行TestSuite/TestCase中的run(result)方法。测试的结果会保存到TextTestResult实例中包括运行了多少测试用例成功了多少失败了多少等信息。 4 Fixture 而对一个测试用例环境的搭建和销毁是一个fixture。 案例定义一个calculate类然后用unittest进行测试 #!/usr/bin/python3 class Math:   def __init__(self,a,b):     self.a int(a)     self.b int(b)def add(self):     return self.a self.b测试代码 #!/usr/bin/python3 from calculator import Math import unittestclass TestMath(unittest.TestCase):   def setUp(self):     print(test start)def test_add(self):     j Math(5,10)     #self.assertEqual(j.add(),15)     self.assertEqual(j.add(),12)def tearDown(self):     print(test end)if __name__ __main__:   suite unittest.TestSuite()   suite.addTest(TestMath(test_add)) runner unittest.TextTestRunner()   runner.run(suite)执行结果 Testing started at 16:39 ... C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\python.exe D:\PyCharm Community Edition 2017.3.3\helpers\pycharm\_jb_unittest_runner.py --path E:/Selenium/unittest/test_Math.py Launching unittests with arguments python -m unittest E:/Selenium/unittest/test_Math.py in E:\Selenium\unittest test start test end Ran 1 test in 0.008s FAILED (failures1) 12 ! 15 Expected :15 Actual   :12  Click to see difference Traceback (most recent call last):   File D:\PyCharm Community Edition 2017.3.3\helpers\pycharm\teamcity\diff_tools.py, line 30, in _patched_equals     old(self, first, second, msg)   File C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\unittest\case.py, line 829, in assertEqual     assertion_func(first, second, msgmsg)   File C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\unittest\case.py, line 822, in _baseAssertEqual     raise self.failureException(msg) AssertionError: 15 ! 12 During handling of the above exception, another exception occurred: Traceback (most recent call last):   File C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\unittest\case.py, line 59, in testPartExecutor     yield   File C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\unittest\case.py, line 605, in run     testMethod()   File E:\Selenium\unittest\test_Math.py, line 13, in test_add     self.assertEqual(j.add(),12) Process finished with exit code 1 因为12 !15,所以报错。   转载于:https://www.cnblogs.com/holly-j/p/8448512.html
http://www.sadfv.cn/news/234278/

相关文章:

  • 如何注册网站域名河南做网站的
  • 网站设计网站浏览智能网站推广优化
  • 门源县电子商务网站建设公司网站制作自己
  • 建视频网站网站空间 php程序
  • wordpress模板站广东网站seo营销
  • 手机怎么制作自己的网站成品app短视频源码搭建
  • 赣州营销型网站策划h5网站动画怎么做
  • 域名打不开原来的网站wordpress插件太大
  • 网站建设的法律问题php网站留言板漏洞
  • 网站设计联系房屋平面设计软件手机版
  • 个人网站服务器推荐南漳县建设局网站
  • 潍坊英文网站建设货代一般都去哪个网站找客户
  • 网站设计规划说明书江西省历史建筑信息平台
  • 试管婴儿网站建设谷歌搜索引擎下载
  • 长沙网站设计培训机构哈尔滨网站建设贴吧
  • 上海网站搜索排名做外贸在哪个网站比较好
  • 做数学题好的网站建设网站需要做的工作内容
  • 推广公司网站有哪些方式兰州响应式网站建设
  • php网站建设教程小米官方网站开发版
  • 响应式网站 开发医院网站推广方法
  • 湘潭网站建设方案咨询初爱视频教程完整版免费观看
  • 网站建设选用平台分析幽默广告软文案例
  • 网站建设接单渠道linux打包网站做备份
  • 淄博北京网站建设公司智慧门店管理服务平台
  • 课程网站建设所用技术公司实力 网站
  • 网站建设怎么做网站好看的个人博客主页
  • 做网站的知识室内设计效果图在哪里找
  • 回龙观做网站免费的app软件下载安装
  • 内部购物券网站怎么做wordpress 文章打不开
  • gl账号注册网站红动在线设计平台