コード例 #1
0
def test_py37_breakpoint(tmpdir):
    f_py = tmpdir.join('f.py')
    f_py.write('def f():\n    breakpoint()\n')
    assert main((str(f_py),)) == 1
コード例 #2
0
def test_syntaxerror_file():
    ret = main([get_resource_path('cannot_parse_ast.notpy')])
    assert ret == 1
コード例 #3
0
def test_non_utf8_file(tmpdir):
    f_py = tmpdir.join('f.py')
    f_py.write_binary('# -*- coding: cp1252 -*-\nx = "€"\n'.encode('cp1252'))
    assert main((str(f_py),)) == 0
コード例 #4
0
def test_returns_one_for_failing_file(tmpdir):
    f_py = tmpdir.join('f.py')
    f_py.write('def f():\n    import pdb; pdb.set_trace()')
    ret = main([str(f_py)])
    assert ret == 1
コード例 #5
0
def test_returns_zero_for_passing_file():
    ret = main([__file__])
    assert ret == 0
コード例 #6
0
def test_py37_breakpoint(tmpdir):
    f_py = tmpdir.join('f.py')
    f_py.write('def f():\n    breakpoint()\n')
    assert main((f_py.strpath,)) == 1
コード例 #7
0
def test_non_utf8_file(tmpdir):
    f_py = tmpdir.join('f.py')
    f_py.write_binary('# -*- coding: cp1252 -*-\nx = "€"\n'.encode('cp1252'))
    assert main((f_py.strpath,)) == 0
コード例 #8
0
def test_syntaxerror_file():
    ret = main([get_resource_path('cannot_parse_ast.notpy')])
    assert ret == 1
コード例 #9
0
def test_returns_zero_for_passing_file():
    ret = main([__file__])
    assert ret == 0
コード例 #10
0
def test_returns_one_for_failing_file(tmpdir):
    f_py = tmpdir.join('f.py')
    f_py.write('def f():\n    import pdb; pdb.set_trace()')
    ret = main([f_py.strpath])
    assert ret == 1