mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
add test to validate a config using !Env
This commit is contained in:
parent
5d938325c4
commit
fd9743cd17
1 changed files with 13 additions and 0 deletions
|
|
@ -62,3 +62,16 @@ def test_mains_not_ok(tmpdir):
|
|||
assert validate_config(('does-not-exist',))
|
||||
assert validate_config((not_yaml.strpath,))
|
||||
assert validate_config((not_schema.strpath,))
|
||||
|
||||
|
||||
def test_validate_config_with_env_ok(tmpdir, caplog):
|
||||
f = tmpdir.join('cfg.yaml')
|
||||
f.write(
|
||||
'repos:\n'
|
||||
'- repo: https://gitlab.com/pycqa/flake8\n'
|
||||
' rev: 3.7.7\n'
|
||||
' hooks:\n'
|
||||
' - id: flake8\n'
|
||||
' args: [--config, !Env "${HOME}/flake8.cfg"]\n',
|
||||
)
|
||||
assert not validate_config((f.strpath,))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue