From f0c67e3ff999cc47a211e7efbea90829a95ef543 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 13 Jul 2023 11:24:28 +0200 Subject: [PATCH] Fix pylint complaints --- python/podio/test_Frame.py | 2 +- python/podio/test_utils.py | 14 +++++++------- tests/root_io/write_frame_root.py | 1 + tests/sio_io/write_frame_sio.py | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/python/podio/test_Frame.py b/python/podio/test_Frame.py index ecf384dcd..b6a1ec1ff 100644 --- a/python/podio/test_Frame.py +++ b/python/podio/test_Frame.py @@ -7,7 +7,7 @@ # using root_io as that should always be present regardless of which backends are built from podio.root_io import Reader -from test_utils import ExampleHitCollection +from .test_utils import ExampleHitCollection # The expected collections in each frame EXPECTED_COLL_NAMES = { diff --git a/python/podio/test_utils.py b/python/podio/test_utils.py index 310e3f964..b5e438fb1 100644 --- a/python/podio/test_utils.py +++ b/python/podio/test_utils.py @@ -2,14 +2,14 @@ """Utilities for python unittests""" import os +import ROOT +from podio.frame import Frame -SKIP_SIO_TESTS = os.environ.get("SKIP_SIO_TESTS", "1") == "1" +ROOT.gSystem.Load("libTestDataModelDict.so") # noqa: E402 +from ROOT import ExampleHitCollection, ExampleClusterCollection # noqa: E402 # pylint: disable=wrong-import-position -import ROOT -ROOT.gSystem.Load("libTestDataModelDict.so") -from ROOT import ExampleHitCollection, ExampleClusterCollection -from podio.frame import Frame +SKIP_SIO_TESTS = os.environ.get("SKIP_SIO_TESTS", "1") == "1" def create_hit_collection(): @@ -47,10 +47,10 @@ def create_frame(): return frame -def write_file(WriterT, filename): +def write_file(writer_type, filename): """Write a file using the given Writer type and put one Frame into it under the events category """ - writer = WriterT(filename) + writer = writer_type(filename) event = create_frame() writer.write_frame(event, "events") diff --git a/tests/root_io/write_frame_root.py b/tests/root_io/write_frame_root.py index 40c712ae7..38bece171 100644 --- a/tests/root_io/write_frame_root.py +++ b/tests/root_io/write_frame_root.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +"""Script to write a Frame in ROOT format""" from podio import test_utils from podio.root_io import Writer diff --git a/tests/sio_io/write_frame_sio.py b/tests/sio_io/write_frame_sio.py index cfa360aa4..94e08aa27 100644 --- a/tests/sio_io/write_frame_sio.py +++ b/tests/sio_io/write_frame_sio.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +"""Script to write a Frame in SIO format""" from podio import test_utils from podio.sio_io import Writer