diff --git a/ops/jujuversion.py b/ops/jujuversion.py index 57153e332..ec701c660 100755 --- a/ops/jujuversion.py +++ b/ops/jujuversion.py @@ -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): diff --git a/pyproject.toml b/pyproject.toml index c7c210455..f8089debc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/test/test_jujuversion.py b/test/test_jujuversion.py index a22cb050d..25692622e 100755 --- a/test/test_jujuversion.py +++ b/test/test_jujuversion.py @@ -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()