pre-commit-hooks/tests/check_python_modules_test.py
2019-02-16 14:15:07 -08:00

13 lines
344 B
Python

import pytest
from pre_commit_hooks.check_python_modules import main
@pytest.mark.parametrize('has_init', (True, False))
def test_main(tmpdir, has_init):
if has_init:
tmpdir.join('__init__.py').ensure()
path = tmpdir.join('thing.py').ensure()
expected = 0 if has_init else 1
assert main((path.strpath,)) == expected