Skip to content

Commit 57b83ec

Browse files
committed
test multiple outputs in convert with kwargs not warning
1 parent 6624511 commit 57b83ec

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/tasks/test_notebook.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,38 @@ def test_can_execute_when_product_is_metaproduct(tmp_directory):
488488
dag.build()
489489

490490

491+
# should not have warning when have multiple exports and
492+
# nbconvert_export_kwargs set
493+
@pytest.mark.parametrize('product, nb_product_key, nbconvert_exporter_name', [
494+
({
495+
'nb': File(Path('out.pdf')),
496+
'file': File(Path('another', 'data', 'file.txt')),
497+
}, 'nb', 'webpdf')
498+
])
499+
def test_multiple_nb_no_kwargs_warning(product, nb_product_key,
500+
nbconvert_exporter_name):
501+
dag = DAG()
502+
503+
code = """
504+
# + tags=["parameters"]
505+
var = None
506+
507+
# +
508+
from pathlib import Path
509+
Path(product['file']).touch()
510+
"""
511+
512+
NotebookRunner(code,
513+
product=product,
514+
dag=dag,
515+
ext_in='py',
516+
nbconvert_exporter_name=nbconvert_exporter_name,
517+
nb_product_key=nb_product_key,
518+
nbconvert_export_kwargs=dict(exclude_input=True),
519+
name='nb')
520+
dag.build()
521+
522+
491523
@pytest.mark.parametrize('product, nb_product_key, nbconvert_exporter_name', [
492524
(
493525
{

0 commit comments

Comments
 (0)