Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip tests failing on windows due to lacking environment #111

Merged
merged 3 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading