mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 20:19:07 +00:00
Ensure python doc tests failures will fail health-check.
And fix a nit in the existing tests to make it pass. BUG=b:219965702 TEST=presubmit Change-Id: I65fb98b04d7042755930dd34913f679fa129c88c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3594248 Reviewed-by: Maciek Swiech <drmasquatch@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
25d7911e8d
commit
a62858f89d
2 changed files with 4 additions and 3 deletions
|
@ -17,8 +17,9 @@ def check_python():
|
|||
print("Running python doctests")
|
||||
for source in Path("tools/impl").glob("*.py"):
|
||||
lib = importlib.import_module(f"impl.{source.stem}")
|
||||
doctest.testmod(lib, optionflags=doctest.ELLIPSIS)
|
||||
|
||||
result = doctest.testmod(lib, optionflags=doctest.ELLIPSIS)
|
||||
if result.failed:
|
||||
sys.exit(1)
|
||||
print("Type-checking python")
|
||||
parallel(
|
||||
mypy("tools/impl"),
|
||||
|
|
|
@ -451,7 +451,7 @@ def batched(source: Iterable[T], max_batch_size: int) -> Iterable[list[T]]:
|
|||
"""
|
||||
Returns an iterator over batches of elements from source_list.
|
||||
|
||||
>>> list(batched([1, 2, 3, 4, 5], batch_size=2))
|
||||
>>> list(batched([1, 2, 3, 4, 5], 2))
|
||||
[[1, 2], [3, 4], [5]]
|
||||
"""
|
||||
source_list = list(source)
|
||||
|
|
Loading…
Reference in a new issue