Skip to content

Commit 7a7b17b

Browse files
committed
fix: pin setuptools<82 for semgrep and fix Odoo 19 TestCursor rename
- Pin setuptools<82 in semgrep additional_dependencies since setuptools 82+ removed pkg_resources - Fix sql_db.TestCursor -> BaseCursor rename in Odoo 19 for fastapi HttpCase tests
1 parent 8979100 commit 7a7b17b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ repos:
298298
hooks:
299299
- id: semgrep
300300
args: ["--config", ".semgrep/", "--error", "--quiet"]
301-
additional_dependencies: ["setuptools"]
301+
additional_dependencies: ["setuptools<82"]
302302
# Only scan OpenSPP spp_* modules (not scripts, endpoint handlers, etc.)
303303
files: ^spp_
304304
# Exclude test files, migrations, and demo-only modules

fastapi/tests/test_fastapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def _get_or_create_demo_user(cls):
8686

8787
@contextmanager
8888
def _mocked_commit(self):
89-
with unittest.mock.patch.object(sql_db.TestCursor, "commit", return_value=None) as mocked_commit:
89+
cursor_cls = getattr(sql_db, "TestCursor", None) or sql_db.BaseCursor
90+
with unittest.mock.patch.object(cursor_cls, "commit", return_value=None) as mocked_commit:
9091
yield mocked_commit
9192

9293
def _assert_expected_lang(self, accept_language, expected_lang):

0 commit comments

Comments
 (0)