Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/quantum/azext_quantum/_version_check_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def check_version(config, reported_version, today):
if latest_version_dict is not None:
latest_version = latest_version_dict['version'].split(' ')[0]

if reported_version != latest_version:
if reported_version != latest_version and reported_version is not None and latest_version is not None:
return (f"\nVersion {reported_version} of the quantum extension is installed locally,"
f" but version {latest_version} is now available.\n"
"You can use 'az extension update -n quantum' to upgrade.\n")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ def test_version_check(self):
test_config = None

message = check_version(test_config, test_current_reported_version, test_old_date)
assert test_current_reported_version in message
assert message is None
# Note: list_versions("quantum") fails during these tests, so latest version number cannot be determined.
# No message is generated if either version number is unavailable.

message = check_version(test_config, test_old_reported_version, test_old_date)
assert test_old_reported_version in message
assert message is None

message = check_version(test_config, test_none_version, test_today)
assert message is None # Note: list_versions("quantum") fails during these tests
assert message is None