PyTest - Writing Assertions
Given the code:
What will happen when this pytest assertion runs?
obj1 = None obj2 = None assert obj1 is obj2
What will happen when this pytest assertion runs?
obj1 = None obj2 = None assert obj1 is obj2
None is a singleton object, so all variables assigned None point to the same object.assert obj1 is obj2 checks if both variables point to the same object, which they do.None is None always True [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions