def test_dispatch():
 gotoutput = pretty.pretty(MyDict())
 expectedoutput = 'MyDict(...)'
 nt.assert_equal(gotoutput, expectedoutput)

def test_dispatch ( ) : gotoutput = pretty . pretty ( MyDict ( ) ) expectedoutput = 'MyDict(...)' nt . assert_equal ( gotoutput , expectedoutput )
test correct dispatching: the _repr_pretty_ method for mydict must be found before the registered printer for dict .