Skip to content

test: add unit tests for AlertDeriver.get_threshold/get_threshold_async - #315

Closed
acailic wants to merge 1 commit into
mainfrom
fix/issue-311-alertderiver-tests
Closed

acailic wants to merge 1 commit into
mainfrom
fix/issue-311-alertderiver-tests

Conversation

@acailic

@acailic acailic commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/alerts/test_alert_deriver_base.py covering AlertDeriver.get_threshold and get_threshold_async via a minimal concrete subclass.
  • Covers: no policy_getter, sync policy_getter (enabled/threshold, disabled, None), and async policy_getter for both sync and async entry points — including the documented sync-context limitation where get_threshold returns the default immediately for a coroutine policy.

Closes #311

Test plan

  • ruff check . — all checks passed
  • python3 -m pytest -q -m 'not e2e' — 3116 passed, 34 skipped, 46 deselected
  • New file alone: pytest -q tests/alerts/test_alert_deriver_base.py — 9 passed, no warnings

Covers sync/async policy_getter paths, disabled policies, and the
documented sync-context limitation where get_threshold returns the
default immediately for coroutine policy getters (fixes #311).
@acailic

acailic commented Sep 11, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #321 — ista pokrivenost (test_alert_deriver_base.py), zeleni CI na 3.10-3.12. Čistimo duplikate auto-workera.

@acailic acailic closed this Sep 11, 2026
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.

test: add unit tests for AlertDeriver.get_threshold/get_threshold_async (27% coverage)

1 participant