mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
13 lines
344 B
Python
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
|