From 7afd7095e25522f8f975069f1fa770136b3efce7 Mon Sep 17 00:00:00 2001 From: Mateusz Jakub Fila Date: Thu, 22 Feb 2024 20:52:22 +0100 Subject: [PATCH] moved python bindings tests cleaned unnecessary import magic --- .../unittests.py => python/podio/test_CodeGen.py | 12 +----------- tests/unittests/CMakeLists.txt | 4 ---- 2 files changed, 1 insertion(+), 15 deletions(-) rename tests/unittests/unittests.py => python/podio/test_CodeGen.py (72%) diff --git a/tests/unittests/unittests.py b/python/podio/test_CodeGen.py similarity index 72% rename from tests/unittests/unittests.py rename to python/podio/test_CodeGen.py index 18416c475..3f1328c22 100644 --- a/tests/unittests/unittests.py +++ b/python/podio/test_CodeGen.py @@ -3,13 +3,7 @@ import unittest import ROOT - -res = ROOT.gSystem.Load("libTestDataModel.so") -if res < 0: - raise RuntimeError("Failed to load libTestDataModel.so") - -from ROOT import MutableExampleMC # pylint: disable=wrong-import-position # noqa: E402 -from ROOT import ExampleMCCollection # pylint: disable=wrong-import-position # noqa: E402 +from ROOT import ExampleMCCollection, MutableExampleMC class ObjectConversionsTest(unittest.TestCase): @@ -37,7 +31,3 @@ def test_add(self): self.assertEqual(len(daughter_particle.parents()), 0) daughter_particle.addparents(parent_particle) self.assertEqual(len(daughter_particle.parents()), 1) - - -if __name__ == "__main__": - unittest.main() diff --git a/tests/unittests/CMakeLists.txt b/tests/unittests/CMakeLists.txt index d95441852..5aa2db37e 100644 --- a/tests/unittests/CMakeLists.txt +++ b/tests/unittests/CMakeLists.txt @@ -94,7 +94,3 @@ else() PODIO_SIOBLOCK_PATH=${CMAKE_CURRENT_BINARY_DIR} ) endif() - -add_test(NAME unittest.py COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/unittests.py) -PODIO_SET_TEST_ENV(unittest.py) -set_tests_properties(unittest.py PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/tests)