mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-02 02:29:16 -05:00
style: apply consistent whitespace and formatting across codebase
This commit is contained in:
@@ -23,16 +23,16 @@ def run_sandbox_tests():
|
||||
print("🧪 TINYTORCH SANDBOX INTEGRITY CHECK")
|
||||
print("="*60)
|
||||
print("\nEnsuring the learning environment is robust...\n")
|
||||
|
||||
|
||||
all_passed = True
|
||||
results = []
|
||||
|
||||
|
||||
for test_module in TEST_MODULES:
|
||||
try:
|
||||
# Import and run the test module
|
||||
print(f"Running {test_module}...")
|
||||
module = importlib.import_module(test_module)
|
||||
|
||||
|
||||
# Look for a main function or run tests directly
|
||||
if hasattr(module, 'main'):
|
||||
result = module.main()
|
||||
@@ -46,25 +46,25 @@ def run_sandbox_tests():
|
||||
func = getattr(module, func_name)
|
||||
func()
|
||||
result = True
|
||||
|
||||
|
||||
results.append((test_module, True, "PASSED"))
|
||||
print(f" ✅ {test_module}: PASSED\n")
|
||||
|
||||
|
||||
except Exception as e:
|
||||
results.append((test_module, False, str(e)))
|
||||
print(f" ❌ {test_module}: FAILED")
|
||||
print(f" Error: {e}\n")
|
||||
all_passed = False
|
||||
|
||||
|
||||
# Summary
|
||||
print("="*60)
|
||||
print("📊 SANDBOX TEST SUMMARY")
|
||||
print("="*60)
|
||||
|
||||
|
||||
for module, passed, status in results:
|
||||
icon = "✅" if passed else "❌"
|
||||
print(f"{icon} {module}: {status}")
|
||||
|
||||
|
||||
if all_passed:
|
||||
print("\n🎉 SANDBOX IS ROBUST!")
|
||||
print("Students can focus on learning ML systems.")
|
||||
@@ -79,7 +79,7 @@ if __name__ == "__main__":
|
||||
# Add the test directory to path
|
||||
test_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(0, test_dir)
|
||||
|
||||
|
||||
# Run tests
|
||||
exit_code = run_sandbox_tests()
|
||||
sys.exit(exit_code)
|
||||
sys.exit(exit_code)
|
||||
|
||||
Reference in New Issue
Block a user