def test_missing_path(self) -> None:
with self.assertRaises(TypeError):
- gpiod.Chip()
+ gpiod.Chip() # type: ignore[call-arg]
def test_invalid_type_for_path(self) -> None:
with self.assertRaises(TypeError):
- gpiod.Chip(4)
+ gpiod.Chip(4) # type: ignore[arg-type]
class ChipBooleanConversion(TestCase):
def test_properties_are_immutable(self) -> None:
with self.assertRaises(AttributeError):
- self.chip.path = "foobar"
+ self.chip.path = "foobar" # type: ignore[misc]
with self.assertRaises(AttributeError):
- self.chip.fd = 4
+ self.chip.fd = 4 # type: ignore[misc]
class ChipDevPathFromLink(TestCase):
chip.close()
with self.assertRaises(gpiod.ChipClosedError):
- chip.path
+ _ = chip.path
def test_close_chip_and_try_controlled_execution(self) -> None:
sim = gpiosim.Chip()
with self.assertRaises(gpiod.ChipClosedError):
with chip:
- chip.fd
+ _ = chip.fd
def test_close_chip_twice(self) -> None:
sim = gpiosim.Chip(label="foobar")
def test_chip_info_properties_are_immutable(self) -> None:
with self.assertRaises(AttributeError):
- self.info.name = "foobar"
+ self.info.name = "foobar" # type: ignore[misc]
with self.assertRaises(AttributeError):
- self.info.num_lines = 4
+ self.info.num_lines = 4 # type: ignore[misc]
with self.assertRaises(AttributeError):
- self.info.label = "foobar"
+ self.info.label = "foobar" # type: ignore[misc]
class ChipInfoStringRepresentation(TestCase):
event = chip.read_info_event()
with self.assertRaises(FrozenInstanceError):
- event.event_type = 4
+ event.event_type = 4 # type: ignore[misc, assignment]
with self.assertRaises(FrozenInstanceError):
- event.timestamp_ns = 4
+ event.timestamp_ns = 4 # type: ignore[misc]
with self.assertRaises(FrozenInstanceError):
- event.line_info = 4
+ event.line_info = 4 # type: ignore[misc, assignment]
def request_reconfigure_release_line(chip_path: str, offset: int) -> None:
def test_watch_line_info_no_arguments(self) -> None:
with self.assertRaises(TypeError):
- self.chip.watch_line_info()
+ self.chip.watch_line_info() # type: ignore[call-arg]
def test_watch_line_info_by_line_name(self) -> None:
self.chip.watch_line_info("foobar")
def test_watch_line_info_invalid_argument_type(self) -> None:
with self.assertRaises(TypeError):
- self.chip.watch_line_info(None)
+ self.chip.watch_line_info(None) # type: ignore[arg-type]
def test_wait_for_event_timeout(self) -> None:
info = self.chip.watch_line_info(7)
def test_unwatch_line_info_no_argument(self) -> None:
with self.assertRaises(TypeError):
- self.chip.unwatch_line_info()
+ self.chip.unwatch_line_info() # type: ignore[call-arg]
def test_unwatch_line_info_by_line_name(self) -> None:
self.chip.watch_line_info(4)
def test_no_offset(self) -> None:
with self.assertRaises(TypeError):
- self.chip.get_line_info()
+ self.chip.get_line_info() # type: ignore[call-arg]
class LinePropertiesCanBeRead(TestCase):
def test_passing_invalid_types_as_configs(self) -> None:
with self.assertRaises(AttributeError):
- self.chip.request_lines("foobar")
+ self.chip.request_lines("foobar") # type: ignore[arg-type]
with self.assertRaises(AttributeError):
- self.chip.request_lines(None, "foobar")
+ self.chip.request_lines(None, "foobar") # type: ignore[arg-type]
def test_offset_out_of_range(self) -> None:
with self.assertRaises(ValueError):
def test_request_no_arguments(self) -> None:
with self.assertRaises(TypeError):
- self.chip.request_lines()
+ self.chip.request_lines() # type: ignore[call-arg]
class ModuleLineRequestsBehaveCorrectlyWithInvalidArguments(TestCase):
def test_passing_invalid_types_as_configs(self) -> None:
with self.assertRaises(AttributeError):
- gpiod.request_lines(self.sim.dev_path, "foobar")
+ gpiod.request_lines(self.sim.dev_path, "foobar") # type: ignore[arg-type]
with self.assertRaises(AttributeError):
- gpiod.request_lines(self.sim.dev_path, None, "foobar")
+ gpiod.request_lines(self.sim.dev_path, None, "foobar") # type: ignore[arg-type]
def test_offset_out_of_range(self) -> None:
with self.assertRaises(ValueError):
def test_request_no_arguments(self) -> None:
with self.assertRaises(TypeError):
- gpiod.request_lines()
+ gpiod.request_lines() # type: ignore[call-arg]
class ChipLineRequestWorks(TestCase):
def test_get_values_invalid_argument_type(self) -> None:
with self.assertRaises(TypeError):
- self.req.get_values(True)
+ self.req.get_values(True) # type: ignore[arg-type]
class LineRequestGettingValuesByName(TestCase):
req.release()
with self.assertRaises(gpiod.RequestReleasedError):
- req.fd
+ _ = req.fd
class LineRequestSurvivesParentChip(TestCase):
def test_is_gpiochip_invalid_argument(self) -> None:
with self.assertRaises(TypeError):
- gpiod.is_gpiochip_device(4)
+ gpiod.is_gpiochip_device(4) # type: ignore[arg-type]
def test_is_gpiochip_superfluous_argument(self) -> None:
with self.assertRaises(TypeError):
- gpiod.is_gpiochip_device("/dev/null", 4)
+ gpiod.is_gpiochip_device("/dev/null", 4) # type: ignore[call-arg]
def test_is_gpiochip_missing_argument(self) -> None:
with self.assertRaises(TypeError):
- gpiod.is_gpiochip_device()
+ gpiod.is_gpiochip_device() # type: ignore[call-arg]
def test_is_gpiochip_good(self) -> None:
sim = gpiosim.Chip()