Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix type hinting on test_jujuversion tests #1011

Merged
merged 6 commits into from
Sep 22, 2023
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 ops/jujuversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __eq__(self, other: Union[str, 'JujuVersion']) -> bool:
and self.build == other.build
and self.patch == other.patch)

def __lt__(self, other: 'JujuVersion') -> bool:
def __lt__(self, other: Union[str, 'JujuVersion']) -> bool:
if self is other:
return False
if isinstance(other, str):
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ docstring-convention = "google"

[tool.pyright]
include = ["ops/*.py", "ops/_private/*.py",
"test/test_log.py",
"test/test_infra.py",
"test/test_jujuversion.py",
"test/test_log.py",
]
pythonVersion = "3.8" # check no python > 3.8 features are used
pythonPlatform = "All"
Expand Down
2 changes: 1 addition & 1 deletion test/test_jujuversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_parsing(self):
self.assertEqual(v.patch, patch)
self.assertEqual(v.build, build)

@unittest.mock.patch('os.environ', new={})
@unittest.mock.patch('os.environ', new={}) # type: ignore
def test_from_environ(self):
# JUJU_VERSION is not set
v = ops.JujuVersion.from_environ()
Expand Down
Loading