Show More
@@ -134,15 +134,20 b' def test_json():' | |||||
134 | lis = [d] |
|
134 | lis = [d] | |
135 | j = display.JSON(d) |
|
135 | j = display.JSON(d) | |
136 | nt.assert_equal(j._repr_json_(), d) |
|
136 | nt.assert_equal(j._repr_json_(), d) | |
|
137 | ||||
137 | with warnings.catch_warnings(record=True) as w: |
|
138 | with warnings.catch_warnings(record=True) as w: | |
|
139 | warnings.simplefilter("always") | |||
138 | j = display.JSON(json.dumps(d)) |
|
140 | j = display.JSON(json.dumps(d)) | |
139 | nt.assert_equal(len(w), 1) |
|
141 | nt.assert_equal(len(w), 1) | |
140 | nt.assert_equal(j._repr_json_(), d) |
|
142 | nt.assert_equal(j._repr_json_(), d) | |
|
143 | ||||
141 | j = display.JSON(lis) |
|
144 | j = display.JSON(lis) | |
142 | nt.assert_equal(j._repr_json_(), lis) |
|
145 | nt.assert_equal(j._repr_json_(), lis) | |
|
146 | ||||
143 | with warnings.catch_warnings(record=True) as w: |
|
147 | with warnings.catch_warnings(record=True) as w: | |
|
148 | warnings.simplefilter("always") | |||
144 | j = display.JSON(json.dumps(lis)) |
|
149 | j = display.JSON(json.dumps(lis)) | |
145 | nt.assert_equal(len(w), 1) |
|
150 | nt.assert_equal(len(w), 1) | |
146 | nt.assert_equal(j._repr_json_(), lis) |
|
151 | nt.assert_equal(j._repr_json_(), lis) | |
147 |
|
152 | |||
148 |
|
153 |
General Comments 0
You need to be logged in to leave comments.
Login now