Skip to content

Commit

Permalink
update: add test for conversion to html (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
krneta authored Aug 15, 2023
1 parent 53b5a92 commit 3f78ffe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/integ_tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ amazon-braket-sdk
amazon-braket-pennylane-plugin
cvxpy
matplotlib
nbconvert
pandas
pennylane
pytest
Expand Down
11 changes: 11 additions & 0 deletions test/integ_tests/test_all_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest

from testbook import testbook
from nbconvert import HTMLExporter
from importlib.machinery import SourceFileLoader

# These notebooks have syntax or dependency issues that prevent them from being tested.
Expand Down Expand Up @@ -74,6 +75,16 @@ def test_all_notebooks(notebook_dir, notebook_file, mock_level):
test_mocks.post_run(tb)


@pytest.mark.parametrize("notebook_dir, notebook_file", test_notebooks)
def test_notebook_to_html_conversion(notebook_dir, notebook_file, mock_level):
os.chdir(root_path)
os.chdir(notebook_dir)

html_exporter = HTMLExporter(template_name='classic')

html_exporter.from_file(notebook_file)


def test_record():
# Set the path here to record results.
notebook_file_search = ""
Expand Down

0 comments on commit 3f78ffe

Please sign in to comment.