Description: Fix for tests in Python 3.12.
 Issue due to referencing config.option.update_snapshots without
 registering the --update-snapshots option in pytest. This could
 also be due to disabling certain tests. To resolve this for now
 added pytest_addoption to register the --update-snapshots option
 + modified pytest_configure to safely check for update_snapshots
 using getattr(config.option, "update_snapshots", False).
Forwarded: not-needed
Author: Yogeswaran Umasankar <yogu@debian.org>
Last-Update: 2024-09-11

--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -38,8 +38,17 @@ def _snapshot_skip_reason():
     return None
 
 
+# Register the --update-snapshots option
+def pytest_addoption(parser):
+    parser.addoption(
+        "--update-snapshots",
+        action="store_true",
+        help="Update snapshots during the test run"
+    )
+
 def pytest_configure(config):
-    if config.option.update_snapshots:
+    # Check if the --update-snapshots option is set
+    if getattr(config.option, "update_snapshots", False):
         from importlib import metadata  # Added in 3.8
 
         for lib, min_ver in SNAPSHOT_MINIMUM_VERSIONS.items():
