MyTetra Share
Делитесь знаниями!
assert-методы в unittest в Python
Время создания: 14.08.2018 10:39
Автор: br0ke
Текстовые метки: python, unittest, test, assert, assertEqual, assertIn, assertIs
Раздел: Информационные технологии - Python - Библиотеки - unittest
Запись: and-semakin/mytetra_data/master/base/1534225142mgq6x5e06t/text.html на raw.githubusercontent.com

Method

Meaning

assertEqual(a, b)

a == b

assertNotEqual(a, b)

a != b

assertGreater(a, b)

a > b

assertGreaterEqual(a, b)

a >= b

assertLess(a, b)

a < b

assertLessEqual(a, b)

a <= b

assertTrue(x)

a == True

assertFalse(x)

a == False

assertIs(a, b)

a is b

assertIsNot(a, b)

a is not b

assertIsNone(x)

x is None

assertIsNotNone(x)

x is not None

assertIn(a, b)

a in b

assertNotIn(a, b)

a not in b

assertIsInstance(a, b)

isinstance(a, b)

assertNotIsInstance(a, b)

not isinstance(a, b)


assertRaises()

assertRaisesRegex()

assertWarns()

assertWarnsRegex()

assertLogs()


assertAlmostEqual(a, b)

assertNotAlmostEqual(a, b)

assertRegex(s, r)

assertNotRegex(s, r)

assertCountEqual(a, b)


assertMultiLineEqual(a, b)

assertSequenceEqual(a, b)

assertListEqual(a, b)

assertTupleEqual(a, b)

assertSetEqual(a, b)

assertDictEqual(a, b)

 
MyTetra Share v.0.65
Яндекс индекс цитирования