test: clean up deprecation warnings - #798
Open
marandaneto wants to merge 1 commit into
Open
Conversation
Contributor
posthog-python Compliance ReportDate: 2026-07-29 08:53:37 UTC ✅ All Tests Passed!111/111 tests passed Capture_V1 Tests✅ 94/94 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
marandaneto
marked this pull request as ready for review
July 29, 2026 09:10
marandaneto
enabled auto-merge (squash)
July 29, 2026 09:10
Contributor
|
Reviews (1): Last reviewed commit: "test: clean up deprecation warnings" | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
The Python 3.14 test job passed with 3,369 warnings, mostly because compatibility tests intentionally exercise deprecated PostHog APIs. That volume makes CI output noisy and can hide newly introduced warnings.
This updates tests to use
secret_keyand metadata-returning Prompts calls where the deprecated behavior is not under test. Intentional compatibility coverage now captures the expected warnings or uses exact, file-local warning filters where wrapping hundreds of calls is impractical. The three tests that each make 1,000 deprecated feature flag calls explicitly assert the expected warning withpytest.warns(...). No global warning suppression was added.💚 How did you test it?
uv run --python 3.14 --extra test pytest -q— 1,888 passed, 15 skipped, 2 remaining third-party warnings (google-genaiandauthlib)uv run --python 3.14 --extra test pytest -q posthog/test/ai/test_prompts.py posthog/test/test_client.py posthog/test/test_client_fork.py posthog/test/test_evaluate_flags.py posthog/test/test_feature_flag_called_minimization.py posthog/test/test_feature_flags.py posthog/test/test_flag_definition_cache.py— 463 passeduv run --python 3.14 --extra test ruff format --check .uv run --python 3.14 --extra test ruff check .📝 Checklist
If releasing new changes
sampo addto generate a changeset file🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Pi coding agent (GPT-5.6) was used to prepare and validate this test-only cleanup; no public session link was generated. The implementation deliberately avoids global suppression: deprecated calls were migrated where practical, intentional compatibility calls were made explicit, and only exact file-local filters were used for the large legacy feature flag suites. The remaining dependency warnings stay visible.