300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > python官方文档怎么样_python官方文档

python官方文档怎么样_python官方文档

时间:2023-03-13 17:55:06

相关推荐

python官方文档怎么样_python官方文档

For production environments it is recommended that tests be driven by a continuous integration system

such as Buildbot , Jenkins or Hudson .

Tools/unittestgui/unittestgui.py

例如:

import unittest

class TestStringMethods(unittest.TestCase):

def test_upper(self):

self.assertEqual('foo'.upper(), 'FOO')

def test_isupper(self):

self.assertTrue('FOO'.isupper())

self.assertFalse('Foo'.isupper())

def test_split(self):

s = 'hello world'

self.assertEqual(s.split(), ['hello', 'world'])

# check that s.split fails when the separator is not a string

with self.assertRaises(TypeError):

s.split(2)

if name == 'main':

unittest.main()

一个TestCase实例的测试代码应该是完全自包含的,这样它可以与任何数量的其他测试用例隔离或任意组合运行。

真正需要做的只是拼出关键的参数(url参数或者body参数)

可以借助装饰器去实现参数组装、日志打印等一系列功能

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。