Comparing dictionaries in doctest Posted by Siew Kam Onn on February 6, 2009 in work, wow Here’s a nifty way to compare dictionaries in doctest in Python. >>> d = function_that_returns_a_dict() >>> expected_d = {… some expected result } >>> d = True if d == expected_d else d>>> dTrue Technorati tags: python, doctest top ↑ Custom Search