Skip to content

Commit

Permalink
#39 #35 manylinux pytest rounding fix (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
myselfhimself committed Aug 24, 2020
1 parent 8342687 commit eb8918d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_gmic_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import pathlib
import re
from math import floor

import gmic
import pytest
Expand Down Expand Up @@ -396,11 +397,12 @@ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):

def assert_get_proper_print_regex(w, h, search_str):
import re

bytes_size = int(round(w) * round(h) * FLOAT_SIZE_IN_BYTES)
bytes_size_str = "{} Kio".format(floor(bytes_size/1024)) if bytes_size > 1024 else "{} b".format(bytes_size)
assert (
re.compile(
r"size = \({},{},1,1\) \[{} b of floats\](.*)\n(.*)\n(.*)min = 0".format(
round(w), round(h), int(round(w) * round(h) * FLOAT_SIZE_IN_BYTES)
r"size = \({},{},1,1\) \[{} of floats\](.*)\n(.*)\n(.*)min = 0".format(
round(w), round(h), bytes_size_str
),
flags=re.MULTILINE,
).search(search_str)
Expand Down

0 comments on commit eb8918d

Please sign in to comment.