Skip to content

test: add tests for the exclusive() operator#788

Draft
github-actions[bot] wants to merge 2 commits into
masterfrom
repo-assist/test-exclusive-operator-2026-05-02-2b47081797817f4d
Draft

test: add tests for the exclusive() operator#788
github-actions[bot] wants to merge 2 commits into
masterfrom
repo-assist/test-exclusive-operator-2026-05-02-2b47081797817f4d

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 2, 2026

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds 10 TestScheduler-based tests for the exclusive() operator in tests/test_observable/test_exclusive.py.

exclusive() subscribes to each inner observable emitted by the outer source one at a time, silently dropping any inner observable that arrives while another is still active. This operator had no tests at all.

Tests added

Test What it verifies
test_exclusive_never never-observable outer → no messages
test_exclusive_empty_outer empty outer → on_completed passes through
test_exclusive_single_inner_completes single inner, all items forwarded
test_exclusive_drops_concurrent_inner inner2 arriving while inner1 is active is silently dropped
test_exclusive_sequential_inners inner2 arriving after inner1 completes is subscribed normally
test_exclusive_multiple_concurrent_drops multiple concurrent arrivals are all dropped
test_exclusive_outer_error error on outer propagates immediately
test_exclusive_inner_error error on inner propagates immediately
test_exclusive_completes_when_outer_and_inner_done completion deferred until both outer and active inner finish
test_exclusive_disposed early disposal stops subscription correctly

Checklist

  • All 10 new tests pass (uv run pytest tests/test_observable/test_exclusive.py)
  • Full suite still passes (uv run pytest — 1491 passed)
  • ruff check and ruff format --check pass
  • CI validates via uv run pytest

Generated by Repo Assist

Note

🔒 Integrity filter blocked 76 items

The following items were blocked because they don't meet the GitHub integrity level.

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by Repo Assist · ● 6.8M ·

10 TestScheduler-based tests covering:
- empty outer observable
- never observable
- single inner completes normally
- concurrent inner dropped while one is active
- sequential inners (second accepted after first completes)
- multiple concurrent inners all dropped
- outer error propagation
- inner error propagation
- deferred completion (outer completes before inner finishes)
- early disposal

Co-authored-by: Copilot <[email protected]>
@dbrattli dbrattli changed the title [Repo Assist] test: add tests for the exclusive() operator test: add tests for the exclusive() operator May 2, 2026
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 93.559% (+0.04%) from 93.524% — repo-assist/test-exclusive-operator-2026-05-02-2b47081797817f4d into master

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants