mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-31 10:36:54 +00:00
Allow customizing the module denylist
This commit is contained in:
parent
6e513a2e71
commit
12f60d656d
2 changed files with 30 additions and 0 deletions
|
|
@ -32,6 +32,20 @@ def test_finds_breakpoint():
|
|||
assert visitor.breakpoints == [Debug(1, 0, 'breakpoint', 'called')]
|
||||
|
||||
|
||||
def test_allow(tmpdir):
|
||||
f_py = tmpdir.join('f.py')
|
||||
f_py.write('import q')
|
||||
ret = main([str(f_py), '--allow', 'q'])
|
||||
assert ret == 0
|
||||
|
||||
|
||||
def test_forbid(tmpdir):
|
||||
f_py = tmpdir.join('f.py')
|
||||
f_py.write('import foo')
|
||||
ret = main([str(f_py), '--forbid', 'foo'])
|
||||
assert ret == 1
|
||||
|
||||
|
||||
def test_returns_one_for_failing_file(tmpdir):
|
||||
f_py = tmpdir.join('f.py')
|
||||
f_py.write('def f():\n import pdb; pdb.set_trace()')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue