def read(*parts):
    """
    Build an absolute path from *parts* and and return the contents of the
    resulting file.  Assume UTF-8 encoding.
    """
    with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f:
        return f.read()
def test_regex_flags_bad_input():
    cases = (
        'abcd',
        'ABCabc'
    )

    case_sensitive = inputs.regex(r'^[A-Z]+$')

    for value in cases:
        yield assert_raises, ValueError, lambda: case_sensitive(value)