MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_linear_methods

Method test_linear_methods

Lib/test/test_trace.py:223–237  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

221
222 @unittest.expectedFailure # TODO: RUSTPYTHON; + {('/Users/al03219714/Projects/RustPython4/crates/pylib/Lib/test/test_trace.py', 108): 1}
223 def test_linear_methods(self):
224 # XXX todo: later add 'static_method_linear' and 'class_method_linear'
225 # here, once issue1764286 is resolved
226 #
227 for methname in ['inst_method_linear',]:
228 tracer = Trace(count=1, trace=0, countfuncs=0, countcallers=0)
229 traced_obj = TracedClass(25)
230 method = getattr(traced_obj, methname)
231 tracer.runfunc(method, 20)
232
233 firstlineno = get_firstlineno(method)
234 expected = {
235 (self.my_py_filename, firstlineno + 1): 1,
236 }
237 self.assertEqual(tracer.results().counts, expected)
238
239
240class TestRunExecCounts(unittest.TestCase):

Callers

nothing calls this directly

Calls 7

runfuncMethod · 0.95
resultsMethod · 0.95
TraceClass · 0.90
TracedClassClass · 0.85
getattrFunction · 0.85
get_firstlinenoFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected