()
| 3134 | |
| 3135 | |
| 3136 | def test_partition_nth(): |
| 3137 | data = list(range(100, 140)) |
| 3138 | random.shuffle(data) |
| 3139 | pivot = 10 |
| 3140 | indices = pc.partition_nth_indices(data, pivot=pivot) |
| 3141 | check_partition_nth(data, indices, pivot, "at_end") |
| 3142 | # Positional pivot argument |
| 3143 | assert pc.partition_nth_indices(data, pivot) == indices |
| 3144 | |
| 3145 | with pytest.raises( |
| 3146 | ValueError, |
| 3147 | match="'partition_nth_indices' cannot be called without options"): |
| 3148 | pc.partition_nth_indices(data) |
| 3149 | |
| 3150 | |
| 3151 | def test_partition_nth_null_placement(): |
nothing calls this directly
no test coverage detected