From: Jérôme Benoit Date: Fri, 11 Sep 2026 16:29:50 +0000 (+0200) Subject: fix(qa): do not commit check tests X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=39142ba3519ae534461de9d1ed6f6090b8fd81f8;p=freqai-strategies.git fix(qa): do not commit check tests --- diff --git a/scripts/test_check_basedpyright.py b/scripts/test_check_basedpyright.py deleted file mode 100644 index dce0176..0000000 --- a/scripts/test_check_basedpyright.py +++ /dev/null @@ -1,52 +0,0 @@ -"""Unit tests for the snapshot comparison logic in check_basedpyright.""" - -import sys -import unittest -from pathlib import Path - -sys.path.insert(0, str(Path(__file__).resolve().parent)) - -from check_basedpyright import ( - SCHEMA_VERSION, - QualityCheckError, - _comparison_key, - _validate_snapshot, -) - -SOURCE = "scripts/check_basedpyright.py" - - -def _snapshot(*, version, message="boom"): - return { - "schemaVersion": SCHEMA_VERSION, - "basedpyrightVersion": version, - "filesAnalyzed": 1, - "sourceFiles": [SOURCE], - "diagnostics": [{"file": SOURCE, "severity": "error", "message": message}], - } - - -class ComparisonKeyTest(unittest.TestCase): - def test_version_drift_only_matches(self): - stored = _validate_snapshot(_snapshot(version="1.40.0")) - current = _validate_snapshot(_snapshot(version="1.40.1")) - self.assertEqual(_comparison_key(stored), _comparison_key(current)) - - def test_diagnostic_change_mismatches(self): - stored = _validate_snapshot(_snapshot(version="1.40.1")) - current = _validate_snapshot(_snapshot(version="1.40.1", message="bam")) - self.assertNotEqual(_comparison_key(stored), _comparison_key(current)) - - def test_empty_version_rejected(self): - with self.assertRaises(QualityCheckError): - _validate_snapshot(_snapshot(version="")) - - def test_missing_key_rejected(self): - snapshot = _snapshot(version="1.40.1") - del snapshot["diagnostics"] - with self.assertRaises(QualityCheckError): - _validate_snapshot(snapshot) - - -if __name__ == "__main__": - unittest.main()