3 Commits

Author SHA1 Message Date
Vinay Umrethe bedb94ef11 feat: Show a summary at end of tests (#425)
* feat: Show a summary at end of tests.

* fix: unnecessary
2026-08-17 22:27:44 +05:30
Philipp Emanuel Weidmann 638a583bd8 chore: bump version to 2.0.0.dev0 (#428) 2026-08-17 16:25:19 +05:30
Philipp Emanuel Weidmann 346d61673b chore: remove Gemini style guide (#427) 2026-08-17 16:19:58 +05:30
2 changed files with 19 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "heretic-llm"
version = "1.4.0"
version = "2.0.0.dev0"
description = "Fully automatic censorship removal for language models"
readme = "README.md"
license = "AGPL-3.0-or-later"
+18 -3
View File
@@ -23,7 +23,9 @@ script_directory = Path(__file__).resolve().parent
project_directory = script_directory.parent
tests_failed = False
# For tracking failures as (test_name, [failed_files]) and successful runs.
failed_tests: list[tuple[str, list[str]]] = []
passed_tests: list[str] = []
for test_directory in script_directory.iterdir():
if test_directory.is_dir():
@@ -65,6 +67,8 @@ for test_directory in script_directory.iterdir():
valid_hashes[filename].append(sha256.lower())
# Track which specific files failed within this test directory.
failed_files: list[str] = []
for filename in valid_hashes:
sha256 = get_file_sha256(test_directory / "model" / filename)
@@ -79,9 +83,20 @@ for test_directory in script_directory.iterdir():
f"{sha256}\n"
)
)
tests_failed = True
failed_files.append(filename)
if tests_failed:
if failed_files:
failed_tests.append((test_directory.name, failed_files))
else:
passed_tests.append(test_directory.name)
if failed_tests:
print("#" * 50)
print("Summary of test failures:")
for test_name, files in failed_tests:
files_str = ", ".join(files)
print(f"- {test_name} (failed files: {files_str})")
print("#" * 50)
sys.exit("Tests failed.")
else:
print("All tests passed.")