Skip to content

Commit

Permalink
Merge pull request #111 from geigerzaehler/g/windows-resize-skip
Browse files Browse the repository at this point in the history
Skip tests failing on windows due to lacking environment
  • Loading branch information
geigerzaehler authored Nov 16, 2024
2 parents 1516c1a + ac88a20 commit 15aebf6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ typeguard = "^4.1.5"
typing-extensions = "^4.9.0"

[tool.pytest.ini_options]
addopts = "--cov --cov-report=term --cov-report=html --cov-branch"
addopts = "--cov --cov-report=term --cov-report=html --cov-branch --doctest-modules"
filterwarnings = [
"error",
"ignore:.*imghdr.*:DeprecationWarning:mediafile",
Expand Down
4 changes: 4 additions & 0 deletions test/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os.path
import platform
import shutil
import sys
from pathlib import Path
from time import sleep

Expand Down Expand Up @@ -340,6 +341,9 @@ def test_unkown_collection(self):
self.runcli("alt", "update", "unkown")
assert str(e.value) == "Alternative collection 'unkown' not found."

@pytest.mark.skipif(
sys.platform.startswith("win"), reason="Image conversion not available"
)
def test_embed_art(self, tmp_path: Path):
"""Test that artwork is embedded and updated to match the source file.
Expand Down
9 changes: 6 additions & 3 deletions test/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,23 @@

@contextmanager
def capture_stdout():
"""Save stdout in a StringIO.
r"""Collect stdout in a StringIO while still outputting it.
>>> with capture_stdout() as output:
... print('spam')
...
spam
>>> output.getvalue()
'spam'
'spam\n'
"""
org = sys.stdout
sys.stdout = StringIO()
buffer = StringIO()
sys.stdout = buffer
try:
yield sys.stdout
finally:
sys.stdout = org
sys.stdout.write(buffer.getvalue())


@contextmanager
Expand Down

0 comments on commit 15aebf6

Please sign in to comment.