Skip to content

Commit

Permalink
Added 'ruff check' unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza committed Oct 3, 2024
1 parent 2e0c6a9 commit 24d7797
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/setuptools_scm/_integration/dump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
TYPE_CHECKING = False
if TYPE_CHECKING:
from typing import Tuple, Union
from typing import Tuple
from typing import Union
VERSION_TUPLE = Tuple[Union[int, str], ...]
else:
Expand Down
8 changes: 8 additions & 0 deletions testing/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ def test_dump_version_flake8(tmp_path: Path) -> None:
subprocess.run([flake8, "VERSION.py"], cwd=tmp_path, check=True)


def test_dump_version_ruff(tmp_path: Path) -> None:
ruff = shutil.which("ruff")
if ruff is None:
pytest.skip("ruff not found")
dump_a_version(tmp_path)
subprocess.run([ruff, "check", "--no-fix", "VERSION.py"], cwd=tmp_path, check=True)


def test_has_command() -> None:
with pytest.warns(RuntimeWarning, match="yadayada"):
assert not has_command("yadayada_setuptools_aint_ne")
Expand Down

0 comments on commit 24d7797

Please sign in to comment.