Skip to content

Commit 24d7797

Browse files
committed
Added 'ruff check' unit test
1 parent 2e0c6a9 commit 24d7797

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/setuptools_scm/_integration/dump_version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
2121
TYPE_CHECKING = False
2222
if TYPE_CHECKING:
23-
from typing import Tuple, Union
23+
from typing import Tuple
24+
from typing import Union
2425
2526
VERSION_TUPLE = Tuple[Union[int, str], ...]
2627
else:

testing/test_functions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ def test_dump_version_flake8(tmp_path: Path) -> None:
153153
subprocess.run([flake8, "VERSION.py"], cwd=tmp_path, check=True)
154154

155155

156+
def test_dump_version_ruff(tmp_path: Path) -> None:
157+
ruff = shutil.which("ruff")
158+
if ruff is None:
159+
pytest.skip("ruff not found")
160+
dump_a_version(tmp_path)
161+
subprocess.run([ruff, "check", "--no-fix", "VERSION.py"], cwd=tmp_path, check=True)
162+
163+
156164
def test_has_command() -> None:
157165
with pytest.warns(RuntimeWarning, match="yadayada"):
158166
assert not has_command("yadayada_setuptools_aint_ne")

0 commit comments

Comments
 (0)