PyTest - Writing Assertions
What will be the result of this pytest assertion?
list1 = [1, 2, 3] list2 = list1 assert list1 is list2
list1 = [1, 2, 3] list2 = list1 assert list1 is list2
list1 and list2 point to the same list object because list2 = list1 assigns the reference.assert list1 is list2 checks identity, which is true here.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions