MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / test_create_class2

Method test_create_class2

test_pydevd_reload/test_pydevd_reload.py:274–297  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

272 self.assertEqual(foo().__name__, "B")
273
274 def test_create_class2(self):
275 SAMPLE_CODE1 = """
276class C(object):
277 def foo(self):
278 return 0
279"""
280 # Creating a new class and using it from old class
281 SAMPLE_CODE2 = """
282class B(object):
283 pass
284
285class C(object):
286 def foo(self):
287 return B
288"""
289
290 self.make_mod(sample=SAMPLE_CODE1)
291 import x # @UnresolvedImport
292
293 foo = x.C().foo
294 self.assertEqual(foo(), 0)
295 self.make_mod(sample=SAMPLE_CODE2)
296 pydevd_reload.xreload(x)
297 self.assertEqual(foo().__name__, "B")
298
299 def test_parent_function(self):
300 SAMPLE_CODE1 = """

Callers

nothing calls this directly

Calls 2

make_modMethod · 0.95
fooFunction · 0.50

Tested by

no test coverage detected