datasette/tests/test_black.py
Simon Willison ade6bae472 Ensure test_black.py executes first under pytest
Otherwise it throws an exception because it gets disrupted by the
asyncio activity in the other tests.
2019-05-03 21:25:49 -04:00

15 lines
356 B
Python

import black
from click.testing import CliRunner
from pathlib import Path
import pytest
import sys
code_root = Path(__file__).parent.parent
def test_black():
runner = CliRunner()
result = runner.invoke(
black.main, [str(code_root / "tests"), str(code_root / "datasette"), "--check"]
)
assert result.exit_code == 0, result.output