Skip to content

test: cover parse_version_string branches#2094

Closed
eeshsaxena wants to merge 1 commit into
weaviate:mainfrom
eeshsaxena:test/parse-version-string
Closed

test: cover parse_version_string branches#2094
eeshsaxena wants to merge 1 commit into
weaviate:mainfrom
eeshsaxena:test/parse-version-string

Conversation

@eeshsaxena

Copy link
Copy Markdown

Description

weaviate.util.parse_version_string turns a version string into a
(major, minor) tuple (stripping a leading v, defaulting a missing minor to
0, ignoring the patch, and raising on unparseable input). The existing suite
only asserted that v-prefixed and bare versions parse equal, leaving the
other branches uncovered.

This adds test/test_parse_version_string.py covering:

  • major/minor parsed with the patch ignored
  • a leading v being stripped
  • a version with no minor defaulting to 0 (e.g. "2" -> (2, 0))
  • ValueError on unparseable / empty input

No source changes.

Verification

pytest test/test_parse_version_string.py - 8 passed. ruff check /
ruff format --check clean.

@orca-security-eu orca-security-eu Bot 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.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

@eeshsaxena eeshsaxena closed this Jul 16, 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.

2 participants