def test_returns_zero_for_passing_file():
    ret = debug_statement_hook([__file__])
    assert ret == 0
def test_syntaxerror_file():
    ret = debug_statement_hook([get_resource_path('cannot_parse_ast.notpy')])
    assert ret == 1
def test_returns_one_for_failing_file():
    ret = debug_statement_hook([get_resource_path('file_with_debug.notpy')])
    assert ret == 1
def test_syntaxerror_file():
    ret = debug_statement_hook([get_resource_path('cannot_parse_ast.notpy')])
    assert ret == 1
def test_returns_zero_for_passing_file():
    ret = debug_statement_hook([__file__])
    assert ret == 0
def test_returns_one_for_failing_file():
    ret = debug_statement_hook([get_resource_path('file_with_debug.notpy')])
    assert ret == 1
def test_non_utf8_file(tmpdir):
    f_py = tmpdir.join('f.py')
    f_py.write_binary('# -*- coding: cp1252 -*-\nx = "€"\n'.encode('cp1252'))
    assert debug_statement_hook((f_py.strpath, )) == 0