Skip to content

Commit

Permalink
make sure each test gets new unmodified test data
Browse files Browse the repository at this point in the history
  • Loading branch information
saimn committed Apr 8, 2024
1 parent 25b2ee9 commit 0b875c0
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions astroscrappy/tests/test_cleaning.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ..astroscrappy import detect_cosmics

import pytest

from . import fake_data
from ..astroscrappy import detect_cosmics


@pytest.fixture
def testdata():
# Get fake data to work on
imdata, crmask = fake_data.make_fake_data()
return imdata, crmask

# Get fake data to work on
imdata, crmask = fake_data.make_fake_data()


def test_median_clean():
def test_median_clean(testdata):
imdata, crmask = testdata
# Because our image only contains single cosmics, turn off
# neighbor detection. Also, our cosmic rays are high enough
# contrast that we can turn our detection threshold up.
Expand All @@ -22,7 +30,8 @@ def test_median_clean():
assert _mask2.sum() == 0


def test_medmask_clean():
def test_medmask_clean(testdata):
imdata, crmask = testdata
# Because our image only contains single cosmics, turn off
# neighbor detection. Also, our cosmic rays are high enough
# contrast that we can turn our detection threshold up.
Expand All @@ -37,7 +46,8 @@ def test_medmask_clean():
assert _mask2.sum() == 0


def test_meanmask_clean():
def test_meanmask_clean(testdata):
imdata, crmask = testdata
# Because our image only contains single cosmics, turn off
# neighbor detection. Also, our cosmic rays are high enough
# contrast that we can turn our detection threshold up.
Expand All @@ -52,7 +62,8 @@ def test_meanmask_clean():
assert _mask2.sum() == 0


def test_idw_clean():
def test_idw_clean(testdata):
imdata, crmask = testdata
# Because our image only contains single cosmics, turn off
# neighbor detection. Also, our cosmic rays are high enough
# contrast that we can turn our detection threshold up.
Expand Down

0 comments on commit 0b875c0

Please sign in to comment.