Skip to content

Commit f5d97d0

Browse files
committed
Address code review
1 parent 4847855 commit f5d97d0

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

tests/hash/hash-test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ def setUpClass(cls):
6161
if not os.path.isdir(CERTS_DIR):
6262
raise unittest.SkipTest("certs directory not found")
6363

64+
config_log = os.path.join(".", "config.log")
65+
if os.path.isfile(config_log):
66+
with open(config_log, "r") as f:
67+
if "disable-filesystem" in f.read():
68+
raise unittest.SkipTest("filesystem support disabled")
69+
6470
def test_md5(self):
6571
r = run_wolfssl("md5", CERT_FILE)
6672
self.assertEqual(r.returncode, 0, r.stderr)

tests/ocsp/ocsp-test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _ocsp_supported(binary):
3838
try:
3939
r = subprocess.run([binary, "ocsp", "-help"],
4040
capture_output=True, timeout=5)
41-
return True
41+
return r.returncode == 0
4242
except (FileNotFoundError, subprocess.TimeoutExpired):
4343
return False
4444

tests/run_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ def main():
3636
for test_file in sorted(glob.glob(pattern, recursive=True)):
3737
suite.addTests(load_tests_from_file(test_file))
3838

39-
runner = unittest.TextTestRunner(verbosity=2, durations=5)
39+
kwargs = dict(verbosity=2)
40+
if sys.version_info >= (3, 12):
41+
kwargs["durations"] = 5
42+
runner = unittest.TextTestRunner(**kwargs)
4043
result = runner.run(suite)
4144
sys.exit(0 if result.wasSuccessful() else 1)
4245

0 commit comments

Comments
 (0)