本文整理匯總了Python中test.seq_tests.CommonTest方法的典型用法代碼示例。如果您正苦於以下問題:Python seq_tests.CommonTest方法的具體用法?Python seq_tests.CommonTest怎麽用?Python seq_tests.CommonTest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類test.seq_tests
的用法示例。
在下文中一共展示了seq_tests.CommonTest方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_iadd
# 需要導入模塊: from test import seq_tests [as 別名]
# 或者: from test.seq_tests import CommonTest [as 別名]
def test_iadd(self):
super(CommonTest, self).test_iadd()
u = self.type2test([0, 1])
u2 = u
u += [2, 3]
self.assert_(u is u2)
u = self.type2test("spam")
u += "eggs"
self.assertEqual(u, self.type2test("spameggs"))
if not test_support.is_jython:
self.assertRaises(TypeError, u.__iadd__, None)
else:
import operator
self.assertRaises(TypeError, operator.__iadd__, u, None)
示例2: test_iadd
# 需要導入模塊: from test import seq_tests [as 別名]
# 或者: from test.seq_tests import CommonTest [as 別名]
def test_iadd(self):
super(CommonTest, self).test_iadd()
u = self.type2test([0, 1])
u2 = u
u += [2, 3]
self.assertIs(u, u2)
u = self.type2test("spam")
u += "eggs"
self.assertEqual(u, self.type2test("spameggs"))
if not test_support.is_jython:
self.assertRaises(TypeError, u.__iadd__, None)
else:
import operator
self.assertRaises(TypeError, operator.__iadd__, u, None)
示例3: test_iadd
# 需要導入模塊: from test import seq_tests [as 別名]
# 或者: from test.seq_tests import CommonTest [as 別名]
def test_iadd(self):
super(CommonTest, self).test_iadd()
u = self.type2test([0, 1])
u2 = u
u += [2, 3]
self.assertIs(u, u2)
u = self.type2test("spam")
u += "eggs"
self.assertEqual(u, self.type2test("spameggs"))
self.assertRaises(TypeError, u.__iadd__, None)