Skip to content
Snippets Groups Projects
Commit 7a067241 authored by Michael Williams's avatar Michael Williams Committed by Colm Talbot
Browse files

TST: add option to skip ROQs tests

parent 1a89e8e8
No related branches found
No related tags found
1 merge request!1331TST: add option to skip ROQs tests
Pipeline #602325 passed with warnings
import pytest
def pytest_addoption(parser):
parser.addoption(
"--skip-roqs", action="store_true", default=False, help="Skip all tests that require ROQs"
)
def pytest_configure(config):
config.addinivalue_line("markers", "requires_roqs: mark a test that requires ROQs")
def pytest_collection_modifyitems(config, items):
if config.getoption("--skip-roqs"):
skip_roqs = pytest.mark.skip(reason="Skipping tests that require ROQs")
for item in items:
if "requires_roqs" in item.keywords:
item.add_marker(skip_roqs)
......@@ -3,6 +3,7 @@ import unittest
import tempfile
from itertools import product
from parameterized import parameterized
import pytest
import h5py
import numpy as np
......@@ -273,6 +274,7 @@ class TestGWTransient(unittest.TestCase):
)
@pytest.mark.requires_roqs
class TestROQLikelihood(unittest.TestCase):
def setUp(self):
self.duration = 4
......@@ -538,6 +540,7 @@ class TestROQLikelihood(unittest.TestCase):
)
@pytest.mark.requires_roqs
class TestRescaledROQLikelihood(unittest.TestCase):
def test_rescaling(self):
......@@ -612,6 +615,7 @@ class TestRescaledROQLikelihood(unittest.TestCase):
)
@pytest.mark.requires_roqs
class TestROQLikelihoodHDF5(unittest.TestCase):
"""
Test ROQ likelihood constructed from .hdf5 basis
......@@ -846,6 +850,7 @@ class TestROQLikelihoodHDF5(unittest.TestCase):
self.assertLess(np.abs(llr - llr_roq), max_llr_error)
@pytest.mark.requires_roqs
class TestCreateROQLikelihood(unittest.TestCase):
"""
Test if ROQ likelihood is constructed without any errors from .hdf5 or .npy basis
......@@ -966,6 +971,7 @@ class TestCreateROQLikelihood(unittest.TestCase):
)
@pytest.mark.requires_roqs
class TestInOutROQWeights(unittest.TestCase):
@parameterized.expand(['npz', 'hdf5'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment