blob: 624396615903b64bb6717e820de30c7b8464c4f3 [file] [log] [blame]
Anthony Sottile8f615292022-01-15 19:24:05 -05001from __future__ import annotations
2
Anthony Sottile030bfac2019-01-31 19:19:10 -08003from pre_commit_hooks.check_ast import main
Anthony Sottile8a8aaf52015-08-04 13:45:41 -07004from testing.util import get_resource_path
5
6
7def test_failing_file():
Anthony Sottile030bfac2019-01-31 19:19:10 -08008 ret = main([get_resource_path('cannot_parse_ast.notpy')])
Anthony Sottile8a8aaf52015-08-04 13:45:41 -07009 assert ret == 1
10
11
12def test_passing_file():
Anthony Sottile030bfac2019-01-31 19:19:10 -080013 ret = main([__file__])
Anthony Sottile8a8aaf52015-08-04 13:45:41 -070014 assert ret == 0