Skip to content

Commit

Permalink
Skip tests if scipy is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybradley committed Sep 5, 2023
1 parent d521935 commit a3fd98f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions photutils/psf/tests/test_groupers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
from numpy.testing import assert_equal

from photutils.psf.groupers import SourceGrouper
from photutils.utils._optional_deps import HAS_SCIPY


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_empty():
"""
Test case when there are no sources.
Expand All @@ -22,6 +24,7 @@ def test_grouper_empty():
grouper(xx, yy)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_one_source():
"""
Test case when there is only one source.
Expand All @@ -34,6 +37,7 @@ def test_grouper_one_source():
assert_equal(groups, gg)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_inputs():
xx = np.array([1, 2, 3, 4])
yy = np.array([1, 2])
Expand All @@ -43,6 +47,7 @@ def test_grouper_inputs():
grouper(xx, yy)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_isolated_sources():
"""
Test case when all sources are isolated.
Expand All @@ -57,6 +62,7 @@ def test_isolated_sources():
assert_equal(groups, gg)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_one():
"""
+---------+--------+---------+---------+--------+---------+
Expand Down Expand Up @@ -96,6 +102,7 @@ def test_grouper_one():
assert_equal(groups, gg)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_two():
"""
+--------------+--------------+-------------+--------------+
Expand Down Expand Up @@ -130,6 +137,7 @@ def test_grouper_two():
assert_equal(groups, gg)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_three():
"""
1 +--+-------+--------+--------+--------+-------+--------+--+
Expand Down Expand Up @@ -164,6 +172,7 @@ def test_grouper_three():
assert_equal(groups, gg)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_four():
"""
+-+---------+---------+---------+---------+-+
Expand Down Expand Up @@ -197,6 +206,7 @@ def test_grouper_four():
assert_equal(groups, gg)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_five():
"""
+--+--------+--------+-------+--------+--------+--------+--+
Expand Down Expand Up @@ -241,6 +251,7 @@ def test_grouper_five():
assert_equal(groups, gg)


@pytest.mark.skipif(not HAS_SCIPY, reason='scipy is required')
def test_grouper_six():
"""
+------+----------+----------+----------+----------+------+
Expand Down

0 comments on commit a3fd98f

Please sign in to comment.