Skip to content

test: assert cli version against package __version__ - #1924

Merged
bhirsz merged 1 commit into
mainfrom
test/harden-version-assertion
Aug 31, 2026
Merged

test: assert cli version against package __version__#1924
bhirsz merged 1 commit into
mainfrom
test/harden-version-assertion

Conversation

@bhirsz

@bhirsz bhirsz commented Aug 31, 2026

Copy link
Copy Markdown
Member

What

Assert the CLI-reported version against robocop.__version__ instead of importlib.metadata.version("robotframework-robocop").

Why

The old assertion compared the CLI output to the installed package metadata. With an editable install this drifts from the source (src/robocop/__init__.py) whenever the version is bumped but the package is not reinstalled, producing a false failure that has nothing to do with the CLI.

What changed

  • tests/test_cli.py: compare against from robocop import __version__.
  • Removed the now-unused from importlib import metadata import.

Tests

tests/test_cli.py::test_version passes; ruff + mypy clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bhirsz
bhirsz merged commit e631ddf into main Aug 31, 2026
11 checks passed
@bhirsz
bhirsz deleted the test/harden-version-assertion branch August 31, 2026 08:14
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