Skip to content

Commit c6c0af4

Browse files
committed
Test notebooks for compliance
1 parent 40a067d commit c6c0af4

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ script:
5050

5151
- if [[ $TEST_TARGET == 'coding_standards' ]]; then
5252
find . -type f -name "*.py" ! -name 'conf.py' | xargs flake8 --max-line-length=100 ;
53+
for file in $(find . -type f -name "*.ipynb"); do jupyter nbconvert --template=tests/strip_markdown.tpl --stdout --to python $file | grep -v '^get_ipython' | flake8 - --ignore=W391,E226,E402 --max-line-length=100 --show-source ; done ;
5354
fi
5455

5556
- if [[ $TEST_TARGET == 'notebooks' ]]; then

tests/strip_markdown.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Remove markdown cells.
2+
{% extends 'python.tpl'%}
3+
{% block markdowncell -%}
4+
{% endblock markdowncell %}
5+
6+
# Change the appearance of execution count.
7+
{% block in_prompt %}
8+
# This was input cell with execution count: {{ cell.execution_count if cell.execution_count else ' ' }}
9+
{%- endblock in_prompt %}

0 commit comments

Comments
 (0)