mirror of
https://github.com/TheLocehiliosan/yadm
synced 2024-10-27 20:34:27 +00:00
Add black to linting
This commit is contained in:
parent
1b36bf2bb6
commit
e704175201
@ -47,6 +47,12 @@ def flake8_version():
|
|||||||
return '6.0.0'
|
return '6.0.0'
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope='session')
|
||||||
|
def black_version():
|
||||||
|
"""Version of black supported"""
|
||||||
|
return '23.1.0'
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
def yamllint_version():
|
def yamllint_version():
|
||||||
"""Version of yamllint supported"""
|
"""Version of yamllint supported"""
|
||||||
|
@ -55,6 +55,16 @@ def test_flake8(pytestconfig, runner, flake8_version):
|
|||||||
assert run.success
|
assert run.success
|
||||||
|
|
||||||
|
|
||||||
|
def test_black(pytestconfig, runner, black_version):
|
||||||
|
"""Passes black"""
|
||||||
|
if not pytestconfig.getoption("--force-linters"):
|
||||||
|
run = runner(command=['black', '--version'], report=False)
|
||||||
|
if black_version not in run.out:
|
||||||
|
pytest.skip('Unsupported black version')
|
||||||
|
run = runner(command=['black', '--check', 'test'])
|
||||||
|
assert run.success
|
||||||
|
|
||||||
|
|
||||||
def test_yamllint(pytestconfig, runner, yamllint_version):
|
def test_yamllint(pytestconfig, runner, yamllint_version):
|
||||||
"""Passes yamllint"""
|
"""Passes yamllint"""
|
||||||
if not pytestconfig.getoption("--force-linters"):
|
if not pytestconfig.getoption("--force-linters"):
|
||||||
|
Loading…
Reference in New Issue
Block a user