Skip to content

Commit 384b5c5

Browse files
fix: rewrite tests to adhere to new implementation of timeout_func
1 parent f8f054f commit 384b5c5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

grader_service/tests/autograding/test_local_grader.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
LocalAutogradeExecutor,
1212
LocalAutogradeProcessExecutor,
1313
)
14-
from grader_service.orm import Assignment, Lecture
14+
from grader_service.orm import Assignment
1515
from grader_service.orm.submission import AutoStatus
1616

1717

@@ -223,8 +223,8 @@ def side_effect():
223223
def test_timeout_function_default(local_autograde_executor):
224224
"""Test default timeout function"""
225225

226-
timeout = local_autograde_executor.timeout_func(Lecture())
227-
assert timeout == 360 # Default timeout
226+
timeout = local_autograde_executor.timeout_func()
227+
assert timeout == 300 # Default timeout
228228

229229

230230
@patch("grader_service.autograding.local_grader.Session")
@@ -235,17 +235,17 @@ def test_timeout_function_default(local_autograde_executor):
235235
def test_timeout_function_custom(mock_git, mock_session_class, tmp_path, submission_123):
236236
"""Test custom timeout function"""
237237

238-
def custom_timeout(lecture):
238+
def custom_timeout():
239239
return 720
240240

241241
executor = LocalAutogradeExecutor(
242242
grader_service_dir=str(tmp_path),
243243
submission=submission_123,
244244
close_session=False,
245-
timeout_func=custom_timeout,
245+
default_cell_timeout=custom_timeout(),
246246
)
247247

248-
timeout = executor.timeout_func(Lecture())
248+
timeout = executor.timeout_func()
249249
assert timeout == 720
250250

251251

@@ -302,7 +302,7 @@ def test_process_executor_run_failure(mock_run, process_executor):
302302
process_executor.output_path,
303303
"-p",
304304
"*.ipynb",
305-
"--ExecutePreprocessor.timeout=360",
305+
"--ExecutePreprocessor.timeout=300",
306306
]
307307

308308
mock_run.assert_called_once_with(

grader_service/tests/handlers/test_base_handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def test_assignment_serialization():
6464
"late_submission": None,
6565
"deadline": datetime.now(tz=timezone.utc).isoformat(),
6666
"group": None,
67+
"cell_timeout": None,
6768
"max_submissions": 1,
6869
"autograde_type": "unassisted",
6970
"allowed_files": None,

0 commit comments

Comments
 (0)