コード例 #1
0
ファイル: test_flake8.py プロジェクト: jayvdb/ebb-lint
 def check(source, sourcefile, no_errors=False):
     # Strip trailing spaces, since the most comfortable triple-quoted
     # string format will have extra spaces on the last line. If this isn't
     # removed, it'll throw off the trailing newline checker.
     source = source.rstrip(' ')
     source, error_locations = find_error_locations(source)
     if no_errors:
         error_locations = []
     sourcefile.write_text(source, encoding='utf-8')
     lint = EbbLint(ast.parse(source), sourcefile.strpath)
     actual = [
         (line, col, message[:4]) for line, col, message, _ in lint.run()]
     assert actual == error_locations
コード例 #2
0
ファイル: test_flake8.py プロジェクト: flowroute/ebb-lint
def assert_ebb_lint(source_text, source_path, error_locations):
    lint = EbbLint(ast.parse(source_text), source_path)
    return [(line, col, message[:4]) for line, col, message, _ in lint.run()]
コード例 #3
0
ファイル: test_flake8.py プロジェクト: jayvdb/ebb-lint-1
def assert_ebb_lint(source_text, source_path, error_locations):
    lint = EbbLint(ast.parse(source_text), source_path)
    actual = {
        (line, col, message[:4]) for line, col, message, _ in lint.run()}
    assert actual == set(error_locations)
コード例 #4
0
def assert_ebb_lint(source_text, source_path, error_locations):
    lint = EbbLint(ast.parse(source_text), source_path)
    return [(line, col, message[:4]) for line, col, message, _ in lint.run()]