]> Nutra Git (v1) - gamesguru/getmyancestors.git/commitdiff
AttributeError: 'CachedSession' object has no attribute 'debug' dev 3/head
authorShane Jaroch <chown_tee@proton.me>
Sat, 24 Jan 2026 07:42:50 +0000 (02:42 -0500)
committerShane Jaroch <chown_tee@proton.me>
Sat, 24 Jan 2026 07:43:01 +0000 (02:43 -0500)
    and lint fixes

Makefile
getmyancestors/classes/session.py
getmyancestors/classes/tree/core.py
tests/offline_test.py

index d60754a8d5fa86a8945481aacba10dfdf2d83f2e..63aa798aa1f0cf15bb9bbfb3883b70940dc3f5ce 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -108,8 +108,8 @@ $(TEST_TARGETS): test/unit/%:
 test:  ##H@@ Run unit & E2E tests
 test: test/unit test/offline test/install test/cov
 
-.PHONY:test/
-test/:test
+.PHONY: test/
+test/: test
 
 .PHONY: test/cov
 test/cov:      ##H@@ Combine all coverage data and show report
index b2cc6035833e0c5aed702a84c79a6d65ec0e5f45..a21ae3eebd94585d6dfe053763e5c32207283bbe 100644 (file)
@@ -138,8 +138,8 @@ class GMASession(requests.Session):
         self.check_license()
 
         # Debug logging toggle
-        # Debug logging toggle
-        if os.environ.get("GMA_DEBUG"):
+        self.debug = bool(os.environ.get("GMA_DEBUG"))
+        if self.debug:
             logger = logging.getLogger()
             logger.setLevel(logging.DEBUG)
             # Add secure filter
@@ -364,9 +364,9 @@ class GMASession(requests.Session):
             )
             with context:
                 self.set_current(auto_login=False)
+            if self.debug:
+                self.write_log(f"Backend path: {self.db_path}", "debug")
             if self.logged and self.fid:
-                if self.verbose:
-                    self.write_log("Successfully reused cached session.")
                 return True
             if self.verbose:
                 self.write_log("Cached session invalid or expired.")
index c3aa0d40d10c21a303fd2501e2f2eabd43d598c0..9b5602e7a1c193bddce525b1a06c4fbc34d46c66 100644 (file)
@@ -56,7 +56,7 @@ class ParentRelType(str, Enum):
 
 class Indi:
     """GEDCOM individual class
-    :param fid' FamilySearch id
+    :param fid: FamilySearch id
     :param tree: a tree object
     :param num: the GEDCOM identifier
     """
index ad04938521b53528dc341085f668f3c9dfec2bb4..eac181050f7d8bda8a571cd8711efef99f203345 100644 (file)
@@ -106,7 +106,7 @@ def check_diff(generated_path, artifact_path, label):
         print(f"✓ {label} matches artifact exactly.")
         return True
 
-    print(f"⚠️  {label} differs from artifact. Showing diff (first 10 lines):")
+    print(f"⚠️  {label} differs from artifact. Showing diff (first 20 lines):")
     print("Diff Stat:")
     subprocess.run(
         [
@@ -120,9 +120,20 @@ def check_diff(generated_path, artifact_path, label):
         check=False,
     )
     print("...")
-    subprocess.run(
-        ["diff", "--color=always", str(generated_path), str(artifact_path)], check=False
-    )
+    # Cap output to avoid massive CI logs
+    try:
+        with subprocess.Popen(
+            ["diff", "--color=always", str(generated_path), str(artifact_path)],
+            stdout=subprocess.PIPE,
+            stderr=subprocess.STDOUT,
+            text=True,
+        ) as diff_proc:
+            stdout, _ = diff_proc.communicate(timeout=5)
+            print("\n".join(stdout.splitlines()[:20]))
+            if len(stdout.splitlines()) > 20:
+                print("... (truncated)")
+    except Exception as e:
+        print(f"Error running diff: {e}")
     print(f"❌ Verified failed for {label}")
     return False