mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-11 09:00:59 +03:00
Removed unittest mock (#10)
* Removed unittest mock * Updated license * Increased timeout --------- Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
This commit is contained in:
parent
7b73d775aa
commit
a56acd86c4
2
.github/workflows/test-windows.yml
vendored
2
.github/workflows/test-windows.yml
vendored
|
@ -37,7 +37,7 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"]
|
python-version: ["pypy3.10", "3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||||
|
|
||||||
timeout-minutes: 30
|
timeout-minutes: 45
|
||||||
|
|
||||||
name: Python ${{ matrix.python-version }}
|
name: Python ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ from io import BytesIO
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from struct import unpack
|
from struct import unpack
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from unittest import mock
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@ -334,12 +333,9 @@ class TestFileAvif:
|
||||||
def test_exif_save(
|
def test_exif_save(
|
||||||
self,
|
self,
|
||||||
tmp_path: Path,
|
tmp_path: Path,
|
||||||
monkeypatch: pytest.MonkeyPatch,
|
|
||||||
bytes: bool,
|
bytes: bool,
|
||||||
orientation: int,
|
orientation: int,
|
||||||
) -> None:
|
) -> None:
|
||||||
mock_avif_encoder = mock.Mock(wraps=_avif.AvifEncoder)
|
|
||||||
monkeypatch.setattr(_avif, "AvifEncoder", mock_avif_encoder)
|
|
||||||
exif = Image.Exif()
|
exif = Image.Exif()
|
||||||
exif[274] = orientation
|
exif[274] = orientation
|
||||||
exif_data = exif.tobytes()
|
exif_data = exif.tobytes()
|
||||||
|
@ -352,7 +348,6 @@ class TestFileAvif:
|
||||||
assert "exif" not in reloaded.info
|
assert "exif" not in reloaded.info
|
||||||
else:
|
else:
|
||||||
assert reloaded.info["exif"] == exif_data
|
assert reloaded.info["exif"] == exif_data
|
||||||
mock_avif_encoder.mock_calls[0].args[16:17] == (b"", orientation)
|
|
||||||
|
|
||||||
def test_exif_invalid(self, tmp_path: Path) -> None:
|
def test_exif_invalid(self, tmp_path: Path) -> None:
|
||||||
with Image.open(TEST_AVIF_FILE) as im:
|
with Image.open(TEST_AVIF_FILE) as im:
|
||||||
|
|
|
@ -51,7 +51,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
Files: apps/shared/iccjpeg.*
|
Files: third_party/iccjpeg/*
|
||||||
|
|
||||||
In plain English:
|
In plain English:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user