MCPcopy Create free account
hub / github.com/ipython/ipython / doctest_hist_op

Function doctest_hist_op

IPython/core/tests/test_magic.py:212–276  ·  view source on GitHub ↗

Test %hist -op In [1]: class b(float): ...: pass ...: In [2]: class s(object): ...: def __str__(self): ...: return 's' ...: In [3]: In [4]: class r(b): ...: def __repr__(self): ...: return 'r'

()

Source from the content-addressed store, hash-verified

210
211@dec.skip_without('sqlite3')
212def doctest_hist_op():
213 """Test %hist -op
214
215 In [1]: class b(float):
216 ...: pass
217 ...:
218
219 In [2]: class s(object):
220 ...: def __str__(self):
221 ...: return 's'
222 ...:
223
224 In [3]:
225
226 In [4]: class r(b):
227 ...: def __repr__(self):
228 ...: return 'r'
229 ...:
230
231 In [5]: class sr(s,r): pass
232 ...:
233
234 In [6]:
235
236 In [7]: bb=b()
237
238 In [8]: ss=s()
239
240 In [9]: rr=r()
241
242 In [10]: ssrr=sr()
243
244 In [11]: 4.5
245 Out[11]: 4.5
246
247 In [12]: str(ss)
248 Out[12]: 's'
249
250 In [13]:
251
252 In [14]: %hist -op
253 >>> class b:
254 ... pass
255 ...
256 >>> class s(b):
257 ... def __str__(self):
258 ... return 's'
259 ...
260 >>>
261 >>> class r(b):
262 ... def __repr__(self):
263 ... return 'r'
264 ...
265 >>> class sr(s,r): pass
266 >>>
267 >>> bb=b()
268 >>> ss=s()
269 >>> rr=r()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected