@devries-cameron20 / composio-1 / commits / edf39a5e1
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(py): register test markers and capture upsert warning (#5347)

This PR: - closes #5310 - registers the existing `core` and `gemini` pytest markers - captures and asserts the expected `upsert()` deprecation warning while preserving parameter-forwarding assertions - resets the once-per-process warning flag with `monkeypatch` so the forwarding test passes independently and in either test order Reproduced all three reported warnings on current `next`: 91 tests passed with 3 warnings before the fix. Only test configuration and an existing test change; SDK runtime behavior and warning filters are unchanged. No changeset is needed. ## How Has This Been Tested? Python 3.14.6, pytest 9.2.0, with the Gemini provider and google-genai installed. From `python/`: ```bash python -m pytest tests/test_normalize_tool_arguments.py tests/test_gemini_provider.py tests/test_experimental_custom_toolkits.py tests/test_experimental_usage.py tests/test_sdk_logging.py tests/test_toolkit_deprecation.py --strict-markers -W error -q ``` 162 passed with zero warnings and no skips. Both `upsert()` tests also passed in reverse order with `--strict-markers -W error`. Ruff lint and format checks passed for the changed test; `git diff --check` passed. The full Python suite was not run locally; GitHub CI covers the broader suite.

Alberto Schiabel committed Nov 13, 2026 at 11:44 UTC edf39a5e1227f5c39ec2f0834e53c45d2c97c971
2 files changed +13 -4
python/pytest.ini
+2
@@ -5,6 +5,8 @@ python_classes = Test*
5 python_functions = test_*
6 addopts = -v --tb=short --ignore-glob=tests/test_type_inference*.py
7 markers =
8 + core: marks core SDK tests
9 + gemini: marks Gemini provider tests
10 slow: marks tests as slow (deselect with '-m "not slow"')
11 integration: marks tests as integration tests
12 unit: marks tests as unit tests
python/tests/test_experimental_custom_toolkits.py
+11 -4
@@ -85,12 +85,19 @@ class TestExperimentalCustomToolkits:
85 assert len(deprecations) == 1
86 assert "create()" in str(deprecations[0].message)
87
88 - def test_upsert_passes_params_through(self, custom_toolkits, mock_client):
88 + def test_upsert_passes_params_through(
89 + self, custom_toolkits, mock_client, monkeypatch
90 + ):
91 mock_client.custom.upsert.return_value = "upserted"
92 + monkeypatch.setattr(experimental_module, "_upsert_warning_emitted", False)
93
91 - result = custom_toolkits.upsert(
92 - slug="MY_TOOLKIT", toolkit_config=TOOLKIT_CONFIG
93 - )
94 + with pytest.warns(
95 + exceptions.ComposioDeprecationWarning,
96 + match=r"custom_toolkits\.upsert\(\) is deprecated",
97 + ):
98 + result = custom_toolkits.upsert(
99 + slug="MY_TOOLKIT", toolkit_config=TOOLKIT_CONFIG
100 + )
101
102 assert result == "upserted"
103 mock_client.custom.upsert.assert_called_once_with(