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
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[build-system]
requires = [
"setuptools == 84.1.0",
"setuptools == 84.2.1",
"setuptools_scm[toml] == 10.3.4",
"frequenz-repo-config[lib] == 0.19.0",
]
Expand Down Expand Up @@ -38,7 +38,7 @@ email = "floss@frequenz.com"

[project.optional-dependencies]
dev-flake8 = [
"flake8 == 7.4.1",
"flake8 == 7.5.0",
"flake8-datetimez == 26.8.1",
"flake8-docstrings == 1.7.0",
"flake8-pyproject == 1.2.4", # For reading the flake8 config from pyproject.toml
Expand All @@ -57,31 +57,31 @@ dev-mkdocs = [
"mkdocs-include-markdown-plugin == 7.3.0",
"mkdocs-literate-nav == 0.6.3",
"mkdocs-macros-plugin == 1.5.0",
"mkdocs-material == 9.7.7",
"mkdocs-material == 9.8.1",
"mkdocstrings[python] == 1.0.8",
"mkdocstrings-python == 2.0.10",
"pymdownx-superfence-filter-lines == 1.0.0",
"griffe==2.3.0",
"griffe==2.4.1",
]
dev-mypy = [
# For checking the noxfile, docs/ script, and tests
"frequenz-channels[dev-mkdocs,dev-noxfile,dev-pytest]",
"mypy == 2.4.1",
"types-Markdown == 3.10.2.20260712",
"types-Markdown == 3.11.3.20261108",
]
dev-noxfile = ["nox == 2026.8.17", "frequenz-repo-config[lib] == 0.19.0"]
dev-noxfile = ["nox == 2026.10.20", "frequenz-repo-config[lib] == 0.19.0"]
dev-pylint = [
# For checking the noxfile, docs/ script, and tests
"frequenz-channels[dev-mkdocs,dev-noxfile,dev-pytest]",
"pylint == 4.0.9",
"pylint == 4.1.4",
]
dev-pytest = [
"async-solipsism == 0.10",
"frequenz-repo-config[extra-lint-examples] == 0.19.0",
"hypothesis == 6.168.3",
"pytest == 9.1.1",
"hypothesis == 6.170.15",
"pytest == 9.2.0",
"pytest-asyncio == 1.5.0",
"pytest-mock == 3.16.0",
"pytest-mock == 3.17.0",
]
dev = [
"frequenz-channels[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
Expand Down
19 changes: 2 additions & 17 deletions tests/test_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,9 @@

"""Tests for the Receiver base class."""

import pytest

from frequenz.channels import Receiver


def test_receiver_without_close_cannot_be_instantiated() -> None:
def test_close_is_abstract() -> None:
"""Test that a receiver subclass has to implement `close()`."""

class NoCloseReceiver(Receiver[int]):
"""A receiver that doesn't implement `close()`."""

async def ready(self) -> bool:
"""Return that the receiver is not ready."""
return False

def consume(self) -> int:
"""Return a message."""
return 0

with pytest.raises(TypeError, match=r"abstract method.*close"):
NoCloseReceiver() # type: ignore[abstract] # pylint: disable=abstract-class-instantiated
assert "close" in Receiver.__abstractmethods__