2022-01-16 08:24:05 +08:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2019-02-01 11:19:10 +08:00
|
|
|
from pre_commit_hooks.check_ast import main
|
2015-08-05 04:45:41 +08:00
|
|
|
from testing.util import get_resource_path
|
|
|
|
|
|
|
|
|
|
|
|
def test_failing_file():
|
2019-02-01 11:19:10 +08:00
|
|
|
ret = main([get_resource_path('cannot_parse_ast.notpy')])
|
2015-08-05 04:45:41 +08:00
|
|
|
assert ret == 1
|
|
|
|
|
|
|
|
|
|
|
|
def test_passing_file():
|
2019-02-01 11:19:10 +08:00
|
|
|
ret = main([__file__])
|
2015-08-05 04:45:41 +08:00
|
|
|
assert ret == 0
|