pre-commit-hooks/tests/check_ast_test.py

15 lines
306 B
Python
Raw Permalink Normal View History

from __future__ import annotations
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():
ret = main([get_resource_path('cannot_parse_ast.notpy')])
2015-08-05 04:45:41 +08:00
assert ret == 1
def test_passing_file():
ret = main([__file__])
2015-08-05 04:45:41 +08:00
assert ret == 0