Skip to content

test(helpers): add unit tests for deprecation helpers - #1483

Open
liuben666 wants to merge 1 commit into
AgentOps-AI:mainfrom
liuben666:add-deprecation-helper-tests
Open

liuben666 wants to merge 1 commit into
AgentOps-AI:mainfrom
liuben666:add-deprecation-helper-tests

Conversation

@liuben666

Copy link
Copy Markdown

Summary

Adds unit tests for the deprecation helpers in agentops/helpers/deprecation.py, which previously had no test coverage:

  • deprecated decorator — asserts the wrapped function still returns its result (pass-through) and emits exactly one deprecation warning on first call, and that repeated calls do not spam the log (deduplication via _shown_warnings).
  • warn_deprecated_param — asserts the correct message is emitted both with and without a suggested replacement.

The tests use monkeypatch to capture logger.warning output and reset _shown_warnings for deterministic assertions.

Test plan

  • pytest tests/unit/helpers/test_deprecation.py passes
  • No production code changed; this is test-only.

…ram()

Signed-off-by: liuben666 <2966426566@qq.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant