mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update test_bisect.py from 3.14.4 (#7609)
This commit is contained in:
1 parent
e195d742af
commit
a02fae38cb
1 file changed
+3
-3
Vendored
+3
-3
@@ -391,9 +391,9 @@ class TestErrorHandlingC(TestErrorHandling, unittest.TestCase):
|
||||
|
||||
class TestDocExample:
|
||||
def test_grades(self):
|
||||
def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):
|
||||
i = self.module.bisect(breakpoints, score)
|
||||
return grades[i]
|
||||
def grade(score):
|
||||
i = self.module.bisect([60, 70, 80, 90], score)
|
||||
return "FDCBA"[i]
|
||||
|
||||
result = [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]
|
||||
self.assertEqual(result, ['F', 'A', 'C', 'C', 'B', 'A', 'A'])
|
||||
|
||||
Reference in new issue
Block a user