'This tests that Unicode strings outside the ASCII character set get
escaped, using byte escapes if they\'re in that range or unicode
escapes if they\'re not.'

def test_unicode_idval(self):

    from _pytest.python import _idval
    values = [(u'', ''), (u'ascii', 'ascii'), (u'a\xe7\xe3o', 'a\\xe7\\xe3o'), (u'jos\xe9@blah.com', 'jos\\xe9@blah.com'), (u'\u03b4\u03bf\u03ba.\u03b9\u03bc\u03ae@\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1.\u03b4\u03bf\u03ba\u03b9\u03bc\u03ae', '\\u03b4\\u03bf\\u03ba.\\u03b9\\u03bc\\u03ae@\\u03c0\\u03b1\\u03c1\\u03ac\\u03b4\\u03b5\\u03b9\\u03b3\\u03bc\\u03b1.\\u03b4\\u03bf\\u03ba\\u03b9\\u03bc\\u03ae')]
    for (val, expected) in values:
        assert (_idval(val, 'a', 6, None) == expected)
