fix(curriculum): check for imports in tests (#65463)

This commit is contained in:
Dario
2026-01-23 19:57:07 +01:00
committed by GitHub
parent a7f3b97cbe
commit 517a61b7d9
2 changed files with 7 additions and 12 deletions
@@ -78,20 +78,14 @@ assert _test_list == [20, 3, 14, 1, 5]
({ test: () => runPython(`assert quick_sort([87, 11, 23, 18, 18, 23, 11, 56, 87, 56]) == [11, 11, 18, 18, 23, 23, 56, 56, 87, 87]`) })
```
You should not use the built-in `sorted()` function in your code.
You should not import any module or use built-in sorting methods in your code.
```js
({ test: () => runPython(`
assert not _Node(_code).block_has_call("sorted")
`) })
```
You should not use the `sort()` method in your code.
```js
({ test: () => runPython(`
assert not _Node(_code).block_has_call("sort")
`) })
assert len(_Node(_code).find_imports()) == 0
assert not _Node(_code).block_has_call("sort")
assert not _Node(_code).block_has_call("sorted")
`)})
```
# --seed--
@@ -50,12 +50,13 @@ Your `selection_sort` function should have one parameter.
)
```
You should not use the built-in `sort()` method or `sorted()` function in your code.
You should not import any module or use built-in sorting methods in your code.
```js
(
{
test: () => runPython(`
assert len(_Node(_code).find_imports()) == 0
assert not _Node(_code).block_has_call("sort")
assert not _Node(_code).block_has_call("sorted")
`)