Skip to content

Commit 32ce19c

Browse files
committed
Keeping Ruff happy.
1 parent 69b4953 commit 32ce19c

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

tests/test_generic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def is_sdk_dbghelp_available():
5656
syswow = ntpath.join(sysroot, "SysWoW64")
5757

5858
# If it's in System32/SysWoW64, it's the system version, not SDK
59-
if pathname.lower().startswith(system.lower()) or pathname.lower().startswith(syswow.lower()):
59+
if pathname.lower().startswith(system.lower()) or pathname.lower().startswith(
60+
syswow.lower()
61+
):
6062
return False
6163

6264
return True
@@ -85,7 +87,7 @@ def test_db_load():
8587

8688
@pytest.mark.skipif(
8789
not is_sdk_dbghelp_available(),
88-
reason="Microsoft SDK (Debugging Tools for Windows) is not installed. Only system dbghelp.dll is available."
90+
reason="Microsoft SDK (Debugging Tools for Windows) is not installed. Only system dbghelp.dll is available.",
8991
)
9092
def test_windbg_version():
9193
from winappdbg import win32

tests/test_miasm_integration.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,24 @@
66

77
import sys
88
import pytest
9+
import importlib.util
910

1011

1112
def is_miasm_available():
1213
"""Check if Miasm is available for import."""
13-
try:
14-
import miasm.analysis.binary
15-
import miasm.analysis.machine
16-
import miasm.core.locationdb
17-
return True
18-
except ImportError:
19-
return False
14+
required_modules = [
15+
"miasm.analysis.binary",
16+
"miasm.analysis.machine",
17+
"miasm.core.locationdb",
18+
]
19+
return all(
20+
importlib.util.find_spec(module) is not None for module in required_modules
21+
)
2022

2123

2224
@pytest.mark.skipif(
2325
not is_miasm_available(),
24-
reason="Miasm is not installed. Install from: https://github.com/cea-sec/miasm"
26+
reason="Miasm is not installed. Install from: https://github.com/cea-sec/miasm",
2527
)
2628
def test_miasm_engine_integration():
2729
"""Test that MiasmEngine integrates properly with WinAppDbg"""

0 commit comments

Comments
 (0)