FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update `Lib` with changed files in `3.13.8` by ShaharNaveh · Pull Request #6186 · RustPython/RustPython · GitHub

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Reaaply patches to test_bytes.py
  • Loading branch information
ShaharNaveh committed Oct 22, 2025
commit 360f8caead1281770adfc9361fb01645ad244d6f
16 changes: 13 additions & 3 deletions Lib/test/test_bytes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,11 @@ def test_irepeat_1char(self):
self.assertEqual(b, b1)
self.assertIs(b, b1)

# NOTE: RUSTPYTHON:
#
# The second instance of self.assertGreater was replaced with
# self.assertGreaterEqual since, in RustPython, the underlying storage
# is a Vec which doesn't require trailing null byte.
def test_alloc(self):
b = bytearray()
alloc = b.__alloc__()
Expand All @@ -1587,10 +1592,15 @@ def test_alloc(self):
for i in range(100):
b += b"x"
alloc = b.__alloc__()
self.assertGreater(alloc, len(b)) # including trailing null byte
self.assertGreaterEqual(alloc, len(b)) # NOTE: RUSTPYTHON patched
if alloc not in seq:
seq.append(alloc)

# NOTE: RUSTPYTHON:
#
# The usages of self.assertGreater were replaced with
# self.assertGreaterEqual since, in RustPython, the underlying storage
# is a Vec which doesn't require trailing null byte.
def test_init_alloc(self):
b = bytearray()
def g():
Expand All @@ -1601,12 +1611,12 @@ def g():
self.assertEqual(len(b), len(a))
self.assertLessEqual(len(b), i)
alloc = b.__alloc__()
self.assertGreater(alloc, len(b)) # including trailing null byte
self.assertGreaterEqual(alloc, len(b)) # NOTE: RUSTPYTHON patched
b.__init__(g())
self.assertEqual(list(b), list(range(1, 100)))
self.assertEqual(len(b), 99)
alloc = b.__alloc__()
self.assertGreater(alloc, len(b))
self.assertGreaterEqual(alloc, len(b)) # NOTE: RUSTPYTHON patched

def test_extend(self):
orig = b'hello'
Expand Down

Back | FazBrowse Home | New Git URL