Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Dec 19, 2017
1 parent 8adab0e commit 070e66f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Tests/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
except ImportError:
pass


def convert_to_comparable(a, b):
new_a, new_b = a, b
if a.mode == 'P':
Expand Down Expand Up @@ -97,7 +98,7 @@ def assert_image_equal(self, a, b, msg=None):
if HAS_UPLOADER:
try:
url = test_image_results.upload(a, b)
logger.error("Url for test images: %s" %url)
logger.error("Url for test images: %s" % url)
except:
pass

Expand Down Expand Up @@ -130,7 +131,7 @@ def assert_image_similar(self, a, b, epsilon, msg=None):
if HAS_UPLOADER:
try:
url = test_image_results.upload(a, b)
logger.error("Url for test images: %s" %url)
logger.error("Url for test images: %s" % url)
except:
pass
raise e
Expand Down Expand Up @@ -207,11 +208,12 @@ def open_withImagemagick(self, f):
return Image.open(outfile)
raise IOError()


@unittest.skipIf(sys.platform.startswith('win32'), "requires Unix or MacOS")
class PillowLeakTestCase(PillowTestCase):
# requires unix/osx
iterations = 100 # count
mem_limit = 512 # k
iterations = 100 # count
mem_limit = 512 # k

def _get_mem_usage(self):
"""
Expand All @@ -221,7 +223,7 @@ def _get_mem_usage(self):
:returns; memory usage in kilobytes
"""

from resource import getpagesize, getrusage, RUSAGE_SELF
from resource import getrusage, RUSAGE_SELF
mem = getrusage(RUSAGE_SELF).ru_maxrss
if sys.platform == 'darwin':
# man 2 getrusage:
Expand Down Expand Up @@ -315,6 +317,7 @@ def imagemagick_available():
def on_appveyor():
return 'APPVEYOR' in os.environ


if sys.platform == 'win32':
IMCONVERT = os.environ.get('MAGICK_HOME', '')
if IMCONVERT:
Expand Down

0 comments on commit 070e66f

Please sign in to comment.