mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-17 08:00:13 +01:00
test: convert tests to pytest assertions; add server-availability skips; clean up warnings and minor syntax/indent issues
This commit is contained in:
parent
f07daaeb4a
commit
947adacfe2
21 changed files with 374 additions and 311 deletions
|
|
@ -71,9 +71,9 @@ def test_m5_structured_logging():
|
|||
print(f"✅ Found event: {event}")
|
||||
else:
|
||||
print(f"❌ Missing event: {event}")
|
||||
|
||||
|
||||
print(f"\n📋 Results: {len(found_events)}/{len(expected_events)} expected events found")
|
||||
|
||||
|
||||
# Test strict mode logging
|
||||
print("\n🔒 Testing strict mode logging...")
|
||||
builder_obj.enforcement_mode = "strict"
|
||||
|
|
@ -82,14 +82,14 @@ def test_m5_structured_logging():
|
|||
print("✅ Strict mode passed (no missing includes)")
|
||||
except RuntimeError as e:
|
||||
print(f"❌ Strict mode failed: {e}")
|
||||
|
||||
return len(found_events) == len(expected_events)
|
||||
|
||||
|
||||
# Final assertion inside try so except/finally remain valid
|
||||
assert len(found_events) == len(expected_events)
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ Test failed with error: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return False
|
||||
finally:
|
||||
logger.removeHandler(handler)
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ def test_m5_performance_metrics():
|
|||
else:
|
||||
print("❌ Performance metrics too slow")
|
||||
|
||||
return performance_acceptable
|
||||
assert performance_acceptable
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue