migrate misc_tests to pytest

This commit is contained in:
Martin Bubel 2023-10-08 23:43:26 +02:00
parent 3695763a5d
commit f95fff1f78

View file

@ -1,20 +1,19 @@
from __future__ import print_function
import numpy as np
import scipy as sp
import GPy
import warnings
class MiscTests(np.testing.TestCase):
class TestMisc:
"""
Testing some utilities of misc
"""
def setUp(self):
def setup(self):
self._lim_val = np.finfo(np.float64).max
self._lim_val_exp = np.log(self._lim_val)
def test_safe_exp_upper(self):
self.setup()
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always") # always print
assert np.isfinite(np.exp(self._lim_val_exp))