Skip to content

Commit

Permalink
Fix few quality issues
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Jul 24, 2023
1 parent 6896f31 commit aa794c2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dump_channel_to_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def download_if_missing(url, fpath, fsize=None, *, force=False):
if not skipped:
fpath.unlink(missing_ok=True)
wget = subprocess.run(
[ # noqa: S603
[
"/usr/bin/env",
"wget",
"-t",
Expand Down
2 changes: 1 addition & 1 deletion hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def initialize(self, version, build_data):
return
Path(self.root).joinpath("src/kolibri2zim/templates/assets")
subprocess.run(
str(Path(self.root).joinpath("get_js_deps.sh")), # noqa : S603
str(Path(self.root).joinpath("get_js_deps.sh")), # : S603
check=True,
)
return super().initialize(version, build_data)
Expand Down
2 changes: 1 addition & 1 deletion src/kolibri2zim/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def main():
logger.error(f"FAILED. An error occurred: {exc}")
if args.debug:
logger.exception(exc)
raise SystemExit(1)
raise SystemExit(1) from exc


if __name__ == "__main__":
Expand Down
13 changes: 3 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ def _scraper(
channel_name: str = CHANNEL_NAME,
channel_description: str = CHANNEL_DESCRIPTION,
channel_author: str | None = None,
additional_options: dict[str, Any] = {},
additional_options: dict[str, Any] | None = None,
) -> Kolibri2Zim:
options = {}
for option_key in expected_options_keys:
options[option_key] = None
options.update(additional_options)
if additional_options:
options.update(additional_options)
scraper = Kolibri2Zim(**options)
scraper.db = FakeDb(
channel_author=channel_author,
Expand All @@ -50,11 +51,3 @@ def _scraper(
return scraper

yield _scraper


# @pytest.fixture
# def default_options() -> Generator[dict[str, Any], None, None]:
# default_options = {}
# for option in options:
# default_options[option] = None
# yield default_options

0 comments on commit aa794c2

Please sign in to comment.