Skip to content

Commit

Permalink
Remove test_sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Feb 15, 2019
1 parent ee5176b commit c23af9b
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions testing/root/test_builtin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
import types
import py
from py.builtin import set, frozenset, reversed, sorted
from py.builtin import set, frozenset

def test_enumerate():
l = [0,1,2]
Expand Down Expand Up @@ -53,29 +53,6 @@ def test_frozenset():
s = set([frozenset([0, 1]), frozenset([1, 0])])
assert len(s) == 1

def test_sorted():
if sorted == py.builtin.sorted:
return # don't test a real builtin
for s in [py.builtin.sorted]:
def test():
assert s([3, 2, 1]) == [1, 2, 3]
assert s([1, 2, 3], reverse=True) == [3, 2, 1]
l = s([1, 2, 3, 4, 5, 6], key=lambda x: x % 2)
assert l == [2, 4, 6, 1, 3, 5]
l = s([1, 2, 3, 4], cmp=lambda x, y: -cmp(x, y))
assert l == [4, 3, 2, 1]
l = s([1, 2, 3, 4], cmp=lambda x, y: -cmp(x, y),
key=lambda x: x % 2)
assert l == [1, 3, 2, 4]

def compare(x, y):
assert type(x) == str
assert type(y) == str
return cmp(x, y)
data = 'The quick Brown fox Jumped over The lazy Dog'.split()
s(data, cmp=compare, key=str.lower)
yield test


def test_print_simple():
from py.builtin import print_
Expand Down

0 comments on commit c23af9b

Please sign in to comment.