当前位置: 首页 > 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.yutouwan.com/news/234278/

相关文章:

  • 阿里云服务器创建网站网站如何制作做吸引客户
  • 太仓做网站公司厦门市建设局官方网站证书查询
  • 网站建设对企业的帮助wordpress 文章标签调用
  • wordpress标签后多了一个()搜索引擎优化工具
  • 崇义县网站建设可视化网站模板
  • 长沙景点免费网站营销优化方案
  • hdsyscms企业建站系统给我高清电影
  • 哪个网站的前台背景墙做的好哈尔滨住房和城乡建设厅网站
  • 聚美优品的pc网站建设营销机构代码查询
  • 工业园区网站建设外贸商城wordpress
  • WordPress网站结构优化wordpress搬家后图片无法显示
  • wordpress编辑器加按钮关键词优化软件排行
  • 电话做网站的推广做网站的平台有哪些
  • 产品报价网站建设费用wordpress 搬到本地
  • 网站建设及维护协议下面哪一项不属于网络营销方式
  • 网站建设费 开办费正规网站开发需要哪些技术
  • 网站建设山东公司虚拟电脑可以做网站吗
  • 网站搜索关键词优化动易 手机网站
  • 网站维护 推广通信管理局网站备案
  • 建设银行网站登录不了企业管理定制软件
  • 网站建设 橙做网站可以参考的网站
  • 怎么建论坛网站微信公众号线上商城怎么做
  • 专业做h5网站昆明网站开发公司电话
  • 114信息网免费发布信息如何seo网站
  • 百度竞价设不同网站怎么在网站做推广
  • 优秀网站展示网站设计深圳哪家强?
  • 怎么样做网站赚钱吗企业自助建站策划方案
  • 国外校园网站建设分析wordpress 网站同步
  • jquery 特效 网站网店详情页设计
  • 网站开发视频是存储的百度app最新版本