Skip to content

Commit

Permalink
fix flaky fetch tests (#255)
Browse files Browse the repository at this point in the history
* fix flaky fetch tests

* style: [pre-commit.ci] auto fixes [...]

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
nclack and pre-commit-ci[bot] authored Dec 15, 2022
1 parent 078b601 commit 0db5c3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion npe2/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def fetch(
manifest_string = getattr(mf, fmt.value)(**kwargs)

if output:
output.write_text(manifest_string)
output.write_text(manifest_string, encoding="utf-8")
else:
_pprint_formatted(manifest_string, fmt)

Expand Down
2 changes: 1 addition & 1 deletion npe2/manifest/_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def from_file(cls, path: Union[Path, str]):
else:
raise ValueError(f"unrecognized file extension: {path}") # pragma: no cover

with open(path) as f:
with open(path, encoding="utf-8") as f:
data = loader(f) or {}

if path.name == "pyproject.toml":
Expand Down
6 changes: 3 additions & 3 deletions tests/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_get_manifest_from_wheel(tmp_path):

def test_get_hub_plugins():
plugins = get_hub_plugins()
assert "napari-svg" in plugins
assert len(plugins) > 0


def test_get_hub_plugin():
Expand All @@ -103,8 +103,8 @@ def test_get_hub_plugin():


def test_get_pypi_plugins():
info = get_pypi_plugins()
assert "napari-svg" in info
plugins = get_pypi_plugins()
assert len(plugins) > 0


@pytest.mark.skipif(not os.getenv("CI"), reason="slow, only run on CI")
Expand Down

0 comments on commit 0db5c3e

Please sign in to comment.