dict_compare /

Filename Size Date modified Message
796 B
2.9 KB
1.1 KB


dict_compare compares two python dictionaries and reports on any differences between them.

This can be very handy when comparing dictionary structures. Typical case is comparing expected and received values in a unittest.

The typical use case is:

import unittest
from dict_compare import dict_compare

class TestSample(unittest.TestCase):
    def test_someExample(self):
        expected_dict = {
            'foo': 'bar',
            'quux': ['some', 'more']
        received_dict = {
            'foo': 'bar',
            'quux': ['some', 'other']
        self.assertTrue( dict_compare(expected_dict, received_dict, )

if __name__ == '__main__':

Have fun!