The current implementation has repetitive pylint directives that disable the "import-outside-toplevel" check on multiple lines within the functions. This repetition can be reduced.
Proposed solution
"""Tests for the ... package."""
+ # pylint: disable=import-outside-toplevel
def test_package_import() -> None:
"""Test that the package can be imported."""
- # pylint: disable=import-outside-toplevel
from frequenz.api import weather
assert weather is not None
def test_module_import_components() -> None:
"""Test that the modules can be imported."""
- # pylint: disable=import-outside-toplevel
- from frequenz.api.weather import weather_pb2
-
- assert weather_pb2 is not None
-
- # pylint: disable=import-outside-toplevel
- from frequenz.api.weather import weather_pb2_grpc
+ # pylint: disable=import-outside-toplevel
+ from frequenz.api.weather import weather_pb2, weather_pb2_grpc
+ assert weather_pb2 is not None
assert weather_pb2_grpc is not None
``
### Use cases
_No response_
### Alternatives and workarounds
_No response_
### Additional context
_No response_
What's needed?
The current implementation has repetitive pylint directives that disable the "import-outside-toplevel" check on multiple lines within the functions. This repetition can be reduced.
Proposed solution