Publish not from the last code cell#

from nbproject import header, publish

header()
idVahIVDKKScdz
version0
time_init2022-07-11 12:16
time_run2023-02-16 12:23
pypackagenbproject==0.8.1 pytest==7.2.1
import pytest

The following will throw an error, because publish is not in the last code cell.

with pytest.raises(RuntimeError):
    publish(i_confirm_i_saved=True)
1 + 1
2