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

Method test_simpledef

IPython/core/tests/test_run.py:230–237  ·  view source on GitHub ↗

Test that simple class definitions work.

(self)

Source from the content-addressed store, hash-verified

228class TestMagicRunSimple(tt.TempFileMixin):
229
230 def test_simpledef(self):
231 """Test that simple class definitions work."""
232 src = ("class foo: pass\n"
233 "def f(): return foo()")
234 self.mktmp(src)
235 _ip.magic('run %s' % self.fname)
236 _ip.run_cell('t = isinstance(f(), foo)')
237 nt.assert_true(_ip.user_ns['t'])
238
239 def test_obj_del(self):
240 """Test that object's __del__ methods are called on exit."""

Callers

nothing calls this directly

Calls 3

mktmpMethod · 0.80
magicMethod · 0.45
run_cellMethod · 0.45

Tested by

no test coverage detected