'Make sure that text which contains non-ascii characters is pasted
correctly. See #1219.'

def test_non_ascii_paste_text(self, testdir):

    testdir.makepyfile(test_unicode="\n                                                #    encoding:    utf-8\n                                                def    test():\n                                                                assert    '\xe2\x98\xba'    ==    1\n                                ")
    result = testdir.runpytest('--pastebin=all')
    if (sys.version_info[0] == 3):
        expected_msg = "*assert    '\xe2\x98\xba'    ==    1*"
    else:
        expected_msg = "*assert    '\\xe2\\x98\\xba'    ==    1*"
    result.stdout.fnmatch_lines([expected_msg, '*==    1    failed    in    *', '*Sending    information    to    Paste    Service*'])
