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

Method test_create_class

test_pydevd_reload/test_pydevd_reload.py:249–272  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

247 pydevd_reload.notify_error = old
248
249 def test_create_class(self):
250 SAMPLE_CODE1 = """
251class C:
252 def foo(self):
253 return 0
254"""
255 # Creating a new class and using it from old class
256 SAMPLE_CODE2 = """
257class B:
258 pass
259
260class C:
261 def foo(self):
262 return B
263"""
264
265 self.make_mod(sample=SAMPLE_CODE1)
266 import x # @UnresolvedImport
267
268 foo = x.C().foo
269 self.assertEqual(foo(), 0)
270 self.make_mod(sample=SAMPLE_CODE2)
271 pydevd_reload.xreload(x)
272 self.assertEqual(foo().__name__, "B")
273
274 def test_create_class2(self):
275 SAMPLE_CODE1 = """

Callers

nothing calls this directly

Calls 2

make_modMethod · 0.95
fooFunction · 0.50

Tested by

no test coverage detected