Skip to content

Commit

Permalink
tests: save_figures is False by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ubmarco committed Jan 4, 2021
1 parent 159f2ca commit 1cf096a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ def obj_equal(class_type, instance1, instance2):


@pytest.fixture(scope='session')
def load_full_features_pdf(tmpdir_factory):
def load_full_features_pdf(tmpdir_factory, request):
"""Load test pdf and return temporary directory path and the libpdf object."""
tmpdir = tmpdir_factory.mktemp('full_features_pdf')
tmpdir_path = str(tmpdir)
return tmpdir_path, load(PDF_FULL_FEATURES, figure_dir=os.path.join(tmpdir_path, 'figures'))
save_figures = request.param if hasattr(request, 'param') else False
return tmpdir_path, load(
PDF_FULL_FEATURES,
save_figures=save_figures,
figure_dir=os.path.join(tmpdir_path, 'figures'),
)
1 change: 1 addition & 0 deletions tests/test_full_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def test_tables(load_full_features_pdf):
assert tables[1].uid == 'chapter.3/table.1'


@pytest.mark.parametrize('load_full_features_pdf', [True], indirect=True) # save figures
def test_figures(load_full_features_pdf):
"""Check if API extract all the figures."""
tmpdir_path, objects = load_full_features_pdf
Expand Down

0 comments on commit 1cf096a

Please sign in to comment.