Skip to content

Commit 2489919

Browse files
committed
Fix pytests
1 parent ca49b05 commit 2489919

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

tests/utils/test_tools.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import os
22
import re
33
import shutil
4-
from subprocess import PIPE, CalledProcessError, run # nosec B404
4+
from subprocess import ( # nosec B404
5+
PIPE,
6+
CalledProcessError,
7+
check_output,
8+
run,
9+
)
510
from unittest.mock import patch
611

712
import pytest
@@ -208,16 +213,16 @@ def test_update_rizin(tmp_path):
208213
download_rizin(target_path)
209214

210215
update_rizin(target_path, target_version_tag)
211-
check_commit = run( # nosec
212-
["git", "rev-parse", "HEAD"],
213-
stdout=PIPE,
214-
stderr=PIPE,
215-
check=True,
216-
cwd=target_path,
216+
current_tag = (
217+
check_output( # nosec
218+
["git", "describe", "--tags"],
219+
cwd=target_path,
220+
)
221+
.decode()
222+
.strip()
217223
)
218-
real_commit = check_commit.stdout.strip().decode()
219224

220-
assert real_commit == target_version_tag
225+
assert current_tag == target_version_tag
221226
assert os.access(
222227
target_path / "build" / "binrz" / "rizin" / "rizin", os.F_OK | os.X_OK
223228
)

0 commit comments

Comments
 (0)