python unittest assertXXX list

How to remember: If you write it by intuition, it will be almost like that

Method Checklist First appearance
assertEqual(a, b) a == b
assertNotEqual(a, b) a != b
assertTrue(x) bool(x) is True
assertFalse(x) bool(x) is False
assertIs(a, b) a is b 2.7
assertIsNot(a, b) a is not b 2.7
assertIsNone(x) x is None 2.7
assertIsNotNone(x) x is not None 2.7
assertIn(a, b) a in b 2.7
assertNotIn(a, b) a not in b 2.7
assertIsInstance(a, b) isinstance(a, b) 2.7
assertNotIsInstance(a, b) not isinstance(a, b) 2.7

Reference http://docs.python.jp/2/library/unittest.html

Recommended Posts

python unittest assertXXX list
[Python] list
Python basics: list
Unittest in python
Python> Comprehension / Comprehension> List comprehension
Python list manipulation
Sorted list in Python
Python Exercise 2 --List Comprehension
Python> list> extend () or + =
Python list comprehension speed
Filter List in Python
Python3 List / dictionary memo
[Memo] Python3 list sort
OpenCV3 Python API list
Python error list (Japanese)
List find in Python
Python exception class list
Initialize list with python
Python hand play (two-dimensional list)
Summary of Python3 list operations
[Python] Convert list to Pandas [Pandas]
[Python] How to use list 1
Specify multiple list indexes (Python)
Python Basic Course (5 List Tuples)
Python list is not a list
[Python] Copy of multidimensional list
[Introduction to Python] <list> [edit: 2020/02/22]
Python list and tuples and commas
Paiza Python Primer 4: List Basics
Python list comprehensions and generators
[Python / PyQ] 4. list, for statement
Unittest and CI in Python
Python #list for super beginners
Getting list elements in Python
Difference between list () and [] in Python
[python] Manage functions in a list
Output 2017 Premium Friday list in Python
Python
Exclude specified cases with Python unittest
[Python] Test sample using unittest2, mock
unittest
Convert list to DataFrame with python
[Python beginner] Divide one list (5 lines).
python / Make a dict from a list.
Python> list> Convert double list to single list
[Python] How to use list 3 Added
Python unittest module execution in vs2017
Write python list fast vim tips
Python3> List generation from iterable> list (range (5))
Delete multiple elements in python list
About the basics list of Python basics
[Introduction to Udemy Python3 + Application] 18. List methods
Python numbers, strings, list types (Python learning memo ①)
[Python] How to convert a 2D list to a 1D list
Python> empty XXX (XXX: dict, list, tuple, set)> {} / [] / () / set ()
LeetCode 141. Linked List Cycle Solution Example (Python)
Display a list of alphabets in Python 3
[Python] Chapter 04-03 Various data structures (multidimensional list)
Python comprehension (list and generator expressions) [additional]
[Python] Chapter 04-04 Various data structures (see list)
Python / numpy> list (numpy array) file save / load