Skip to content

test(inbound): resolve CodeQL "assert has a side-effect" alerts - #16

Merged
tuyakhov merged 1 commit into
claude/gallant-einstein-czq95mfrom
claude/gallant-einstein-codeql-assert
Jul 29, 2026
Merged

test(inbound): resolve CodeQL "assert has a side-effect" alerts#16
tuyakhov merged 1 commit into
claude/gallant-einstein-czq95mfrom
claude/gallant-einstein-codeql-assert

Conversation

@tuyakhov

Copy link
Copy Markdown
Contributor

What

CodeQL is flagging four "assert statement has a side-effect" alerts in
tests/test_inbound.py — the reason the CodeQL check is red on the base
inbound PR. Each is a delete() call placed directly inside an assert:

assert client.inbound.addresses.delete("inb_1") is True

Because assert is stripped under python -O, the delete would silently not
run. Fix: assign the result to a local, then assert on the value:

deleted = client.inbound.addresses.delete("inb_1")
assert deleted is True

Applied to all four flagged sites (sync + async, addresses + domains). No
behavior change — the requests still fire and the assertions still hold.

Verification

  • ruff format --check / ruff check — clean
  • pytest tests/test_inbound.py — 18 passed
  • No remaining calls inside assert statements in the file

Targeted at the base inbound branch so its CodeQL check clears.


Generated by Claude Code

CodeQL flags `assert <call> is True` because the call is skipped when asserts
are disabled (python -O). Assign each delete() result to a local first, then
assert on the value. Resolves the four "assert statement has a side-effect"
code-scanning alerts on tests/test_inbound.py. No behavior change.
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tuyakhov
tuyakhov merged commit 99ae882 into claude/gallant-einstein-czq95m Jul 29, 2026
7 checks passed
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.

2 participants