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

Method g

Lib/test/test_bytes.py:1617–1625  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1615 def test_init_alloc(self):
1616 b = bytearray()
1617 def g():
1618 for i in range(1, 100):
1619 yield i
1620 a = list(b)
1621 self.assertEqual(a, list(range(1, len(a)+1)))
1622 self.assertEqual(len(b), len(a))
1623 self.assertLessEqual(len(b), i)
1624 alloc = b.__alloc__()
1625 self.assertGreaterEqual(alloc, len(b)) # NOTE: RUSTPYTHON patched
1626 b.__init__(g())
1627 self.assertEqual(list(b), list(range(1, 100)))
1628 self.assertEqual(len(b), 99)

Callers

nothing calls this directly

Calls 6

listClass · 0.85
lenFunction · 0.85
assertLessEqualMethod · 0.80
__alloc__Method · 0.80
assertGreaterEqualMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected