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

Method test_parent_function

test_pydevd_reload/test_pydevd_reload.py:299–329  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

297 self.assertEqual(foo().__name__, "B")
298
299 def test_parent_function(self):
300 SAMPLE_CODE1 = """
301class B(object):
302 def foo(self):
303 return 0
304
305class C(B):
306 def call(self):
307 return self.foo()
308"""
309 # Creating a new class and using it from old class
310 SAMPLE_CODE2 = """
311class B(object):
312 def foo(self):
313 return 0
314 def bar(self):
315 return 'bar'
316
317class C(B):
318 def call(self):
319 return self.bar()
320"""
321
322 self.make_mod(sample=SAMPLE_CODE1)
323 import x # @UnresolvedImport
324
325 call = x.C().call
326 self.assertEqual(call(), 0)
327 self.make_mod(sample=SAMPLE_CODE2)
328 pydevd_reload.xreload(x)
329 self.assertEqual(call(), "bar")
330
331 def test_update_constant(self):
332 SAMPLE_CODE1 = """

Callers

nothing calls this directly

Calls 2

make_modMethod · 0.95
callFunction · 0.50

Tested by

no test coverage detected