Skip to content

Commit

Permalink
Merge pull request #6141 from radarhere/imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Mar 22, 2022
2 parents a6a843e + 2a285d1 commit d0f1f66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
10 changes: 3 additions & 7 deletions Tests/test_file_libtiff.py
Expand Up @@ -4,7 +4,6 @@
import os
import re
from collections import namedtuple
from ctypes import c_float

import pytest

Expand Down Expand Up @@ -168,14 +167,11 @@ def test_write_metadata(self, tmp_path):
val = original[tag]
if tag.endswith("Resolution"):
if legacy_api:
assert (
c_float(val[0][0] / val[0][1]).value
== c_float(value[0][0] / value[0][1]).value
assert val[0][0] / val[0][1] == (
4294967295 / 113653537
), f"{tag} didn't roundtrip"
else:
assert (
c_float(val).value == c_float(value).value
), f"{tag} didn't roundtrip"
assert val == 37.79000115940079, f"{tag} didn't roundtrip"
else:
assert val == value, f"{tag} didn't roundtrip"

Expand Down
3 changes: 2 additions & 1 deletion Tests/test_image_access.py
@@ -1,4 +1,3 @@
import ctypes
import os
import subprocess
import sys
Expand Down Expand Up @@ -404,6 +403,8 @@ class TestEmbeddable:
"not from shell",
)
def test_embeddable(self):
import ctypes

with open("embed_pil.c", "w") as fh:
fh.write(
"""
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_imagewin_pointers.py
@@ -1,4 +1,3 @@
import ctypes
from io import BytesIO

from PIL import Image, ImageWin
Expand All @@ -8,6 +7,7 @@
# see https://github.com/python-pillow/Pillow/pull/1431#issuecomment-144692652

if is_win32():
import ctypes
import ctypes.wintypes

class BITMAPFILEHEADER(ctypes.Structure):
Expand Down

0 comments on commit d0f1f66

Please sign in to comment.