diff --git a/setup.py b/setup.py index 1e5397e9..11ad2fed 100644 --- a/setup.py +++ b/setup.py @@ -54,6 +54,7 @@ setup( "pytest-asyncio==0.10.0", "aiohttp==3.5.3", "beautifulsoup4==4.6.1", + "black", ] }, tests_require=["datasette[test]"], diff --git a/tests/test_black.py b/tests/test_black.py new file mode 100644 index 00000000..37fca5a6 --- /dev/null +++ b/tests/test_black.py @@ -0,0 +1,19 @@ +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 / "datasette"), "--check"] + ) + assert result.exit_code == 0, result.output