forked from Rust-related/RustPython
Merge pull request #4774 from MegasKomnenos/bisect
Update bisect.py and test_bisect.py from CPython v3.11.2
This commit is contained in:
2
Lib/bisect.py
vendored
2
Lib/bisect.py
vendored
@@ -107,4 +107,4 @@ except ImportError:
|
||||
|
||||
# Create aliases
|
||||
bisect = bisect_right
|
||||
insort = insort_right
|
||||
insort = insort_right
|
||||
|
||||
8
Lib/test/test_bisect.py
vendored
8
Lib/test/test_bisect.py
vendored
@@ -5,7 +5,7 @@ from collections import UserList
|
||||
|
||||
|
||||
py_bisect = import_helper.import_fresh_module('bisect', blocked=['_bisect'])
|
||||
c_bisect = import_helper.import_fresh_module('bisect', fresh=['bisect'])
|
||||
c_bisect = import_helper.import_fresh_module('bisect', fresh=['_bisect'])
|
||||
|
||||
class Range(object):
|
||||
"""A trivial range()-like object that has an insert() method."""
|
||||
@@ -257,6 +257,12 @@ class TestBisect:
|
||||
target
|
||||
)
|
||||
|
||||
def test_insort_keynotNone(self):
|
||||
x = []
|
||||
y = {"a": 2, "b": 1}
|
||||
for f in (self.module.insort_left, self.module.insort_right):
|
||||
self.assertRaises(TypeError, f, x, y, key = "b")
|
||||
|
||||
class TestBisectPython(TestBisect, unittest.TestCase):
|
||||
module = py_bisect
|
||||
|
||||
|
||||
Reference in New Issue
Block a user