Skip to content

Commit da4fdcd

Browse files
committed
Fix pytests
1 parent ca49b05 commit da4fdcd

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

tests/utils/test_tools.py

Lines changed: 10 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,12 @@ 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+
current_tag = check_output( # nosec
217+
["git", "describe", "--tags"],
216218
cwd=target_path,
217-
)
218-
real_commit = check_commit.stdout.strip().decode()
219+
).decode()
219220

220-
assert real_commit == target_version_tag
221+
assert current_tag == target_version_tag
221222
assert os.access(
222223
target_path / "build" / "binrz" / "rizin" / "rizin", os.F_OK | os.X_OK
223224
)

0 commit comments

Comments
 (0)