"""Testing utilities."""


import os
import re
import threading
import functools
from tempfile import NamedTemporaryFile

from numpy import testing
import numpy as np
from ._warnings import expected_warnings
import warnings

from .. import data, io, img_as_uint, img_as_float, img_as_int, img_as_ubyte


SKIP_RE = re.compile("(\s*>>>.*?)(\s*)#\s*skip\s+if\s+(.*)$")


def _assert_less(a, b, msg=None):
    message = "%r is not lower than %r" % (a, b)
    if msg is not None:
        message += ": " + msg
    assert a < b, message


def _assert_greater(a, b, msg=None):
    message = "%r is not greater than %r" % (a, b)
    if msg is not None:
        message += ": " + msg
    assert a > b, message