Skip to content

Commit 3b7e941

Browse files
committed
respect_config
1 parent 66987a8 commit 3b7e941

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

IPython/core/magics/basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ def notebook(self, s):
632632
)
633633
# Sign the notebook to make it trusted
634634
notary = NotebookNotary()
635+
notary.update_config(self.shell.config)
635636
notary.sign(nb)
636637
with io.open(outfname, "w", encoding="utf-8") as f:
637638
write(nb, f, version=4)

tests/test_magic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ def test_notebook_export_json():
10041004

10051005
_ip = get_ipython()
10061006
_ip.history_manager.reset() # Clear any existing history.
1007+
_ip.run_line_magic("config", "NotebookNotary.algorithm = 'sha384'")
10071008
cmds = ["a=1", "def b():\n return a**2", "print('noël, été', b())"]
10081009
for i, cmd in enumerate(cmds, start=1):
10091010
_ip.history_manager.store_inputs(i, cmd)
@@ -1024,7 +1025,7 @@ def test_notebook_export_json():
10241025
assert kernelspec["language"] == "python"
10251026

10261027
# Check if notebook is trusted
1027-
notary = sign.NotebookNotary()
1028+
notary = sign.NotebookNotary(algorithm="sha384")
10281029
is_trusted = notary.check_signature(nb)
10291030
assert is_trusted, "Exported notebook should be trusted"
10301031

0 commit comments

Comments
 (0)