Skip to content

Commit

Permalink
tests:linting - add test script to run black and ruff locally
Browse files Browse the repository at this point in the history
It is not run by pytest unless called explicitly due to the filename not starting with test_
  • Loading branch information
MatteoCampinoti94 committed Nov 3, 2023
1 parent ff21f14 commit 41650ee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/linting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import subprocess
from pathlib import Path


def test_black(test_folder: Path):
completed_process = subprocess.run(
["poetry", "run", "black", "--check", str(test_folder.parent)],
check=False,
)
assert completed_process.returncode == 0


def test_ruff(test_folder: Path):
completed_process = subprocess.run(
["poetry", "run", "ruff", "check", str(test_folder.parent)],
check=False,
)
assert completed_process.returncode == 0

0 comments on commit 41650ee

Please sign in to comment.