Skip to content

Commit

Permalink
fix: Repair loading builders without pytest and make code more explic…
Browse files Browse the repository at this point in the history
…it/safe about such issue
  • Loading branch information
inkhey authored Nov 16, 2021
1 parent 13f2620 commit 47517e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions preview_generator/preview/builder/document__scribus.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
from subprocess import check_output
import typing

import pytest

from preview_generator.exception import BuilderDependencyNotFound
from preview_generator.extension import mimetypes_storage
from preview_generator.preview.builder.document_generic import DocumentPreviewBuilder
Expand All @@ -32,7 +30,6 @@
SCRIPT_PATH = os.path.join(parent_dir, SCRIPT_FOLDER_NAME, SCRIPT_NAME)


@pytest.mark.xfail(reason="Broken builder ?")
class DocumentPreviewBuilderScribus(DocumentPreviewBuilder):

weight = 110
Expand Down
5 changes: 4 additions & 1 deletion preview_generator/preview/builder_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ def load_builders(self, force: bool = False) -> None:
builder_modules = get_builder_modules(builder_folder)

for module_name in builder_modules:
import_builder_module(module_name)
try:
import_builder_module(module_name)
except Exception:
self.logger.critical("Builder {} failed to be loaded".format(module_name))

from preview_generator.preview.generic_preview import PreviewBuilder # nopep8

Expand Down

0 comments on commit 47517e5

Please sign in to comment.