def test_syntax_error_with_non_ascii_chars(testdir):
 testdir.makepyfile(u'\n    # -*- coding: UTF-8 -*-\n\n    \u2603\n    ')
 result = testdir.runpytest()
 result.stdout.fnmatch_lines(['*ERROR collecting*', '*SyntaxError*', '*1 error in*'])

def test_syntax_error_with_non_ascii_chars ( testdir ) : testdir . makepyfile ( u'\n    # -*- coding: UTF-8 -*-\n\n    \u2603\n    ' ) result = testdir . runpytest ( ) result . stdout . fnmatch_lines ( [ '*ERROR collecting*' , '*SyntaxError*' , '*1 error in*' ] )
fix decoding issue while formatting syntaxerrors during collection .