From b33fd4307a5156ae6ebc7ef62fb08680d7ffd90b 2013-05-29 02:57:08 From: MinRK Date: 2013-05-29 02:57:08 Subject: [PATCH] test pretty print when __module__ is None --- diff --git a/IPython/lib/tests/test_pretty.py b/IPython/lib/tests/test_pretty.py index eff710f..689ae48 100644 --- a/IPython/lib/tests/test_pretty.py +++ b/IPython/lib/tests/test_pretty.py @@ -53,6 +53,11 @@ class Dummy1(object): class Dummy2(Dummy1): _repr_pretty_ = None +class NoModule(object): + pass + +NoModule.__module__ = None + def test_indentation(): """Test correct indentation in groups""" @@ -106,3 +111,10 @@ def test_pprint_heap_allocated_type(): import xxlimited output = pretty.pretty(xxlimited.Null) nt.assert_equal(output, 'xxlimited.Null') + +def test_pprint_nomod(): + """ + Test that pprint works for classes with no __module__. + """ + output = pretty.pretty(NoModule) + nt.assert_equal(output, 'NoModule')