sqlite-utils/tests/test_black.py
Simon Willison 56e29158fe Don't run black test on Python 3.7
It breaks on that version - see https://github.com/ambv/black/issues/425

But that's OK, we only need it to run onder one version anyway.
2018-07-28 11:18:40 -07:00

20 lines
519 B
Python

import black
from click.testing import CliRunner
from pathlib import Path
import pytest
import sys
code_root = Path(__file__).parent.parent
@pytest.mark.skipif(
sys.version_info[:2] > (3, 6),
reason="Breaks on 3.7 at the moment, but it only needs to run under one Python version",
)
def test_black():
runner = CliRunner()
result = runner.invoke(
black.main,
[str(code_root / "tests"), str(code_root / "sqlite_utils"), "--check"],
)
assert result.exit_code == 0, result.output