@@ -556,7 +556,7 @@ def test_cell_output_to_nodes(doctree):
556
556
cell = from_dict (cell )
557
557
output_node , = cell_output_to_nodes (cell ["outputs" ], True , output_dir , None )
558
558
image_node , = output_node .traverse (image )
559
- assert output_node [ 0 ] .attributes ['uri' ] == img_locs [index ]
559
+ assert image_node .attributes ['uri' ] == img_locs [index ]
560
560
561
561
# Testing inline functionality
562
562
outputs = [
@@ -609,7 +609,7 @@ def test_save_script(doctree):
609
609
a = 1
610
610
print(a)
611
611
"""
612
- tree , app , _ = doctree (source , return_all = True )
612
+ _ , app , _ = doctree (source , return_all = True )
613
613
outdir = Path (app .outdir )
614
614
saved_text = (outdir / '../jupyter_execute/test.py' ).read_text ()
615
615
assert saved_text .startswith ('#!/usr/bin/env python' )
@@ -690,7 +690,7 @@ def test_output_only_error(doctree):
690
690
4
691
691
"""
692
692
with pytest .raises (ExtensionError ):
693
- tree = doctree (source )
693
+ doctree (source )
694
694
695
695
def test_multiple_directives (doctree ):
696
696
source = """
@@ -714,3 +714,21 @@ def test_multiple_directives(doctree):
714
714
assert ex_out .children [0 ].astext ().strip () == "4"
715
715
assert jin_in .children [0 ].astext ().strip () == "3 + 3"
716
716
assert jin_out .children [0 ].astext ().strip () == "5"
717
+
718
+
719
+ def test_builder_priority (doctree ):
720
+ source = """
721
+ .. jupyter-execute::
722
+
723
+ display({"text/plain": "I am html output", "text/latex": "I am latex"})
724
+ """
725
+ config = (
726
+ "render_priority_html = ['text/plain', 'text/latex']\n "
727
+ "render_priority_latex = ['text/latex', 'text/plain']"
728
+ )
729
+ _ , app , _ = doctree (source , config = config , return_all = True , buildername = "html" )
730
+ html = (Path (app .outdir ) / "index.html" ).read_text ()
731
+ assert "I am html output" in html
732
+ _ , app , _ = doctree (source , config = config , return_all = True , buildername = "latex" )
733
+ latex = (Path (app .outdir ) / "python.tex" ).read_text ()
734
+ assert "I am latex" in latex
0 commit comments