Skip to content

feat(pytest-plugin): negative assertion methods - #492

Merged
bepri merged 3 commits into
mainfrom
work/assert_no_pytest_plugin/CRAFT-5335
Oct 9, 2026
Merged

bepri merged 3 commits into
mainfrom
work/assert_no_pytest_plugin/CRAFT-5335

Conversation

@bepri

@bepri bepri commented Oct 8, 2026 •

Copy link
Copy Markdown
Member
  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run make lint && make test?

assert_messages and assert_interactions are out of scope as they are different search mechanisms that don't really need negation available.

Closes #489

@bepri bepri self-assigned this Oct 8, 2026
Copilot AI lite review requested due to automatic review settings October 8, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The assertion API is incomplete and inconsistently named, required Ruff suppressions need restoration, and negative-regex coverage is missing.

2 open findings
What changed in this PR

Adds negative assertion helpers to the pytest recording emitter and tests their behavior.

Changes:

  • Adds assert_no_* helpers with regex and progress support.
  • Adds tests for negative assertions.
  • Updates Ruff lint suppressions for local imports.
File Summary
tests/​test_pytest_plugin.py Tests negative assertion behavior.
tests/​integration/​test_messages_integration.py Updates import lint suppressions.
craft_cli/​pytest_plugin.py Implements negative assertion helpers.
craft_cli/​messages.py Updates Windows-only import lint handling.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread craft_cli/messages.py Outdated
Comment thread tests/integration/test_messages_integration.py Outdated
@bepri
bepri force-pushed the work/assert_no_pytest_plugin/CRAFT-5335 branch from 15b8abf to a05a1ce Compare October 8, 2026 22:15
@bepri
bepri requested a lite review from Copilot October 8, 2026 22:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved API coverage, lint failure, and missing test coverage remain.

2 open findings
2 resolved since last review

🧠 Review effort: Lite

Comment thread craft_cli/pytest_plugin.py
Comment thread craft_cli/pytest_plugin.py
@bepri
bepri requested review from a team and lengau October 8, 2026 22:26
@bepri
bepri marked this pull request as ready for review October 8, 2026 22:26
@lengau
lengau requested a review from a team October 9, 2026 03:11
Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
@bepri
bepri merged commit 4b57ac4 into main Oct 9, 2026
31 checks passed
@bepri
bepri deleted the work/assert_no_pytest_plugin/CRAFT-5335 branch October 9, 2026 17:49
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.

Add negative assertions in pytest plugin

4 participants