Skip to content

Commit

Permalink
Merge branch 'main' into pyright-test_jujuversion-1007
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoyt authored Sep 22, 2023
2 parents 01d64ac + fa60525 commit 3290800
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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_jujuversion.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
9 changes: 5 additions & 4 deletions test/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,26 @@

import io
import logging
import typing
import unittest
from unittest.mock import patch

import ops.log
from ops.model import MAX_LOG_LINE_LEN, _ModelBackend


class FakeModelBackend:
class FakeModelBackend(_ModelBackend):

def __init__(self):
self._calls = []
self._calls: typing.List[typing.Tuple[str, str]] = []

def calls(self, clear=False):
def calls(self, clear: bool = False):
calls = self._calls
if clear:
self._calls = []
return calls

def juju_log(self, level, message):
def juju_log(self, level: str, message: str):
for line in _ModelBackend.log_split(message):
self._calls.append((level, line))

Expand Down

0 comments on commit 3290800

Please sign in to comment.