Skip to content

Commit

Permalink
Add black to linting
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLocehiliosan committed Jul 12, 2023
1 parent 1b36bf2 commit e704175
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ def flake8_version():
return '6.0.0'


@pytest.fixture(scope='session')
def black_version():
"""Version of black supported"""
return '23.1.0'


@pytest.fixture(scope='session')
def yamllint_version():
"""Version of yamllint supported"""
Expand Down
10 changes: 10 additions & 0 deletions test/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ def test_flake8(pytestconfig, runner, flake8_version):
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):
"""Passes yamllint"""
if not pytestconfig.getoption("--force-linters"):
Expand Down

0 comments on commit e704175

Please sign in to comment.