7
7
@pytest .mark .parametrize (
8
8
("table" , "comparator" , "expected" ),
9
9
[
10
- # Check that it works with an empty table when https://github.com/Safe-DS/Stdlib/issues/75 is fixed.
10
+ (
11
+ Table (),
12
+ lambda row1 , row2 : row1 ["col1" ] - row2 ["col1" ],
13
+ Table (),
14
+ ),
11
15
(
12
16
Table ({"col1" : [3 , 2 , 1 ]}),
13
17
lambda row1 , row2 : row1 ["col1" ] - row2 ["col1" ],
14
18
Table ({"col1" : [1 , 2 , 3 ]}),
15
19
),
16
20
],
21
+ ids = ["empty" , "3 rows" ],
17
22
)
18
23
def test_should_return_sorted_table (
19
24
table : Table ,
@@ -27,13 +32,18 @@ def test_should_return_sorted_table(
27
32
@pytest .mark .parametrize (
28
33
("table" , "comparator" , "expected" ),
29
34
[
30
- # Check that it works with an empty table when https://github.com/Safe-DS/Stdlib/issues/75 is fixed.
35
+ (
36
+ Table (),
37
+ lambda row1 , row2 : row1 ["col1" ] - row2 ["col1" ],
38
+ Table (),
39
+ ),
31
40
(
32
41
Table ({"col1" : [3 , 2 , 1 ]}),
33
42
lambda row1 , row2 : row1 ["col1" ] - row2 ["col1" ],
34
43
Table ({"col1" : [3 , 2 , 1 ]}),
35
44
),
36
45
],
46
+ ids = ["empty" , "3 rows" ],
37
47
)
38
48
def test_should_not_modify_original_table (
39
49
table : Table ,
@@ -43,7 +53,3 @@ def test_should_not_modify_original_table(
43
53
table .sort_rows (comparator )
44
54
assert table .schema == expected .schema
45
55
assert table == expected
46
-
47
-
48
- def test_should_not_sort_anything_on_empty_table () -> None :
49
- assert Table () == Table ().sort_rows (lambda row1 , row2 : row1 ["col1" ] - row2 ["col1" ])
0 commit comments