Skip to content

Commit 95bb70e

Browse files
committed
Remove outdated tests
1 parent 28e6eac commit 95bb70e

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

light-curve/tests/light_curve_ext/test_dmdt.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,8 @@ def test_dmdt_points_dtype(t_dtype, m_dtype):
282282
t = np.linspace(0, 1, 11, dtype=t_dtype)
283283
m = np.asarray(t, dtype=m_dtype)
284284
dmdt = DmDt.from_borders(min_lgdt=0, max_lgdt=1, max_abs_dm=1, lgdt_size=2, dm_size=2, norm=[])
285-
if t_dtype is m_dtype:
286-
context = nullcontext()
287-
else:
288-
context = pytest.raises(TypeError)
289-
with context:
290-
dmdt.points(t, m)
285+
values = dmdt.points(t, m)
286+
assert values.dtype == np.result_type(t, m)
291287

292288

293289
@pytest.mark.parametrize("t_dtype,m_dtype,sigma_dtype", product(*[[np.float32, np.float64]] * 3))
@@ -296,12 +292,8 @@ def test_dmdt_gausses_dtype(t_dtype, m_dtype, sigma_dtype):
296292
m = np.asarray(t, dtype=m_dtype)
297293
sigma = np.asarray(t, dtype=sigma_dtype)
298294
dmdt = DmDt.from_borders(min_lgdt=0, max_lgdt=1, max_abs_dm=1, lgdt_size=2, dm_size=2, norm=[])
299-
if t_dtype is m_dtype is sigma_dtype:
300-
context = nullcontext()
301-
else:
302-
context = pytest.raises(TypeError)
303-
with context:
304-
dmdt.gausses(t, m, sigma)
295+
values = dmdt.gausses(t, m, sigma)
296+
assert values.dtype == np.result_type(t, m, sigma)
305297

306298

307299
@pytest.mark.parametrize("t1_dtype,m1_dtype,t2_dtype,m2_dtype", product(*[[np.float32, np.float64]] * 4))

light-curve/tests/light_curve_ext/test_feature.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,20 +358,20 @@ def test_raises_for_wrong_inputs():
358358
fe = lc.Amplitude()
359359

360360
# First argument
361-
with pytest.raises(TypeError, match="'t' has type 'list'"):
362-
fe([1.0, 2.0, 3.0], [1.0, 2.0, 3.0])
361+
with pytest.raises(TypeError, match="'t' has type 'int'"):
362+
fe(5, [1.0, 2.0, 3.0])
363363
with pytest.raises(TypeError, match="'t' is a 2-d array"):
364364
fe(np.array([[1.0, 2.0, 3.0]]), np.array([1.0, 2.0, 3.0]))
365-
with pytest.raises(TypeError, match="'t' has dtype int64"):
366-
fe(np.array([1, 2, 3], dtype=np.int64), np.array([[1.0, 2.0, 3.0]]))
365+
with pytest.raises(TypeError, match="'t' has dtype <U1"):
366+
fe(np.array(["a", "b", "c"]), np.array([1.0, 2.0, 3.0]))
367367

368368
# Second and third arguments
369369
t = np.arange(10, dtype=np.float64)
370370
with pytest.raises(ValueError, match="Mismatched lengths:"):
371371
fe(t, np.arange(11, dtype=np.float64))
372372
with pytest.raises(TypeError, match="'m' must be a numpy array"):
373-
fe(t, list(t))
373+
fe(t, set(t))
374374
with pytest.raises(TypeError, match="'sigma' is a 0-d array"):
375375
fe(t, t, np.array(1.0))
376376
with pytest.raises(TypeError, match="Mismatched dtypes:"):
377-
fe(t, t.astype(np.float32))
377+
fe(t, t.astype(str) + "x")

0 commit comments

Comments
 (0)