2018-07-28 07:29:20 -07:00
|
|
|
import black
|
|
|
|
|
from click.testing import CliRunner
|
|
|
|
|
from pathlib import Path
|
2018-07-28 11:18:40 -07:00
|
|
|
import pytest
|
|
|
|
|
import sys
|
2018-07-28 07:29:20 -07:00
|
|
|
|
|
|
|
|
code_root = Path(__file__).parent.parent
|
|
|
|
|
|
|
|
|
|
|
2019-01-24 19:08:52 -08:00
|
|
|
@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",
|
|
|
|
|
)
|
2018-07-28 07:29:20 -07:00
|
|
|
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
|