Skip to content

Commit

Permalink
Skip tests if data not available
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Oct 12, 2023
1 parent 7ae97a6 commit 75a6d43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions python/podio/test_ReaderRoot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import unittest

from test_Reader import ReaderTestCaseMixin, LegacyReaderTestCaseMixin # pylint: disable=import-error
from test_utils import LEGACY_DATA_AVAILABLE

from podio.root_io import Reader, LegacyReader

Expand All @@ -16,6 +17,7 @@ def setUp(self):
self.reader = Reader('root_io/example_frame.root')


@unittest.skipIf(not LEGACY_DATA_AVAILABLE, "no legacy input data available")
class RootLegacyReaderTestCase(LegacyReaderTestCaseMixin, unittest.TestCase):
"""Test cases for the legacy root input files and reader."""
def setUp(self):
Expand Down
4 changes: 2 additions & 2 deletions python/podio/test_ReaderSio.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest

from test_Reader import ReaderTestCaseMixin, LegacyReaderTestCaseMixin # pylint: disable=import-error
from test_utils import SKIP_SIO_TESTS # pylint: disable=import-error
from test_utils import SKIP_SIO_TESTS, LEGACY_DATA_AVAILABLE # pylint: disable=import-error


@unittest.skipIf(SKIP_SIO_TESTS, "no SIO support")
Expand All @@ -17,7 +17,7 @@ def setUp(self):
self.reader = Reader('sio_io/example_frame.sio')


@unittest.skipIf(SKIP_SIO_TESTS, "no SIO support")
@unittest.skipIf(SKIP_SIO_TESTS or not LEGACY_DATA_AVAILABLE, "no SIO support or data not available")
class SIOLegacyReaderTestCase(LegacyReaderTestCaseMixin, unittest.TestCase):
"""Test cases for the legacy root input files and reader."""
def setUp(self):
Expand Down
2 changes: 1 addition & 1 deletion python/podio/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


SKIP_SIO_TESTS = os.environ.get("SKIP_SIO_TESTS", "1") == "1"

LEGACY_DATA_AVAILABLE = os.environ.get("PODIO_TEST_INPUT_DATA_DIR", None) is not None

def create_hit_collection():
"""Create a simple hit collection with two hits for testing"""
Expand Down

0 comments on commit 75a6d43

Please sign in to comment.