Skip to content

Commit

Permalink
Fix setting of cell execution timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
tuncbkose committed Feb 1, 2023
1 parent ca7b0e5 commit c3176fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nbgrader/preprocessors/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Execute(NbGraderPreprocessor, ExecutePreprocessor):
interrupt_on_timeout = Bool(True)
allow_errors = Bool(True)
raise_on_iopub_timeout = Bool(True)
timeout = Integer(30)
timeout = Integer(30).tag(config=True)

error_on_timeout = {
"ename": "CellTimeoutError",
Expand Down
7 changes: 2 additions & 5 deletions nbgrader/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,8 @@ def _preprocess(self, nb: NotebookNode) -> NotebookNode:
resources = {}
with utils.setenv(NBGRADER_VALIDATING='1', NBGRADER_EXECUTION='validate'):
for preprocessor in self.preprocessors:
# https://github.com/jupyter/nbgrader/pull/1075
# It seemes that without the self.config passed below,
# --ExecutePreprocessor.timeout doesn't work. Better solution
# requested, unknown why this is needed.
pp = preprocessor(**self.config[preprocessor.__name__])
# Let configuration be handled by traitlets
pp = preprocessor(parent=self)
nb, resources = pp.preprocess(nb, resources)
return nb

Expand Down

0 comments on commit c3176fb

Please sign in to comment.