diff --git a/IPython/lib/tests/test_pretty.py b/IPython/lib/tests/test_pretty.py index 817616c..b12c6d4 100644 --- a/IPython/lib/tests/test_pretty.py +++ b/IPython/lib/tests/test_pretty.py @@ -84,6 +84,20 @@ def test_callability_checking(): nt.assert_equal(gotoutput, expectedoutput) + +def test_sets(): + """ + Test that set and frozenset use Python 3 formatting. + """ + objects = [set(), frozenset(), set([1]), frozenset([1]), set([1,2]), + frozenset([1,2])] + expected = ['set()', 'frozenset()', '{1}', 'frozenset({1})', '{1, 2}', + 'frozenset({1, 2})'] + for obj, expected_output in zip(objects, expected): + got_output = pretty.pretty(obj) + yield nt.assert_equal, got_output, expected_output + + @skip_without('xxlimited') def test_pprint_heap_allocated_type(): """