From 4f658378eb8732c6047c3cd12c462b0d20ea910f Mon Sep 17 00:00:00 2001 From: Marko Durkovic Date: Thu, 21 Oct 2021 18:00:44 +0200 Subject: [PATCH] Fix lint for updated tools --- src/rosbags/typesys/__main__.py | 4 ++-- tests/test_serde.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rosbags/typesys/__main__.py b/src/rosbags/typesys/__main__.py index 4396fcaf..07593d2d 100644 --- a/src/rosbags/typesys/__main__.py +++ b/src/rosbags/typesys/__main__.py @@ -31,12 +31,12 @@ def main() -> None: # pragma: no cover for fname in files: path = Path(root, fname) if path.suffix == '.idl': - typs.update(get_types_from_idl(path.read_text())) + typs.update(get_types_from_idl(path.read_text(encoding='utf-8'))) elif path.suffix == '.msg': name = path.relative_to(path.parents[2]).with_suffix('') if '/msg/' not in str(name): name = name.parent / 'msg' / name.name - typs.update(get_types_from_msg(path.read_text(), str(name))) + typs.update(get_types_from_msg(path.read_text(encoding='utf-8'), str(name))) register_types(typs) (selfdir / 'types.py').write_text(generate_python_code(typs)) diff --git a/tests/test_serde.py b/tests/test_serde.py index a5e646ff..a8e95edf 100644 --- a/tests/test_serde.py +++ b/tests/test_serde.py @@ -178,7 +178,9 @@ def _comparable(): frombuffer = numpy.frombuffer def arreq(self: MagicMock, other: Union[MagicMock, Any]) -> bool: - return (getattr(self, '_mock_wraps') == getattr(other, '_mock_wraps', other)).all() + lhs = self._mock_wraps # pylint: disable=protected-access + rhs = getattr(other, '_mock_wraps', other) + return (lhs == rhs).all() class CNDArray(MagicMock): """Mock ndarray."""