Suppose I have two Python dictionaries - dictA and dictB. I need to find out if there are any keys which are present in dictB but not
dictA
dictB
If you want a built-in solution for a full comparison with arbitrary dict structures, @Maxx's answer is a good start.
import unittest test = unittest.TestCase() test.assertEqual(dictA, dictB)