Skip to content

Commit

Permalink
testing NotebookRunner.debug()
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Blancas Reyes committed Oct 5, 2020
1 parent cc6efb0 commit f96de36
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_notebook_task.py
@@ -1,3 +1,5 @@
import mock
import builtins
from pathlib import Path

import pytest
Expand Down Expand Up @@ -359,3 +361,26 @@ def test_hot_reload(tmp_directory):
assert report['Ran?'] == [True]

# TODO: check task is not marked as outdated


@pytest.mark.parametrize('kind', ['ipdb', 'pdb', 'pm'])
def test_debug(kind, tmp_directory):
dag = DAG()

code = """
# + tags=["parameters"]
1 + 1
"""

t = NotebookRunner(code,
product=File(Path(tmp_directory, 'out.ipynb')),
dag=dag,
kernelspec_name='python3',
params={'var': 1},
ext_in='py',
name='nb')

dag.render()

with mock.patch.object(builtins, 'input', lambda *args: 'quit'):
t.debug(kind=kind)

0 comments on commit f96de36

Please sign in to comment.