Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed Jan 3, 2024
2 parents c5f26a6 + d4a3d86 commit 38220d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions doc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ redrock Change Log
0.18.1 (unreleased)
-------------------

* Write test files to temporary directory (PR `#263`_).
* Check template dimension so code works on a single template (PR `#264`_).

.. _`#263`: https://github.com/desihub/redrock/pull/263
.. _`#264`: https://github.com/desihub/redrock/pull/264

0.18.0 (2023-09-14)
Expand Down
15 changes: 7 additions & 8 deletions py/redrock/test/test_io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import division, print_function

import os
import os, tempfile
from shutil import rmtree
import unittest
from uuid import uuid1
import numpy as np
Expand All @@ -18,14 +19,18 @@ class TestIO(unittest.TestCase):
#- Create unique test filename in a subdirectory
@classmethod
def setUpClass(cls):
cls.testfile = 'test-{uuid}.h5'.format(uuid=uuid1())
cls.testDir = tempfile.mkdtemp()
cls.testfile = os.path.join(cls.testDir, 'test-{uuid}.h5'.format(uuid=uuid1()))

#- Cleanup test files if they exist
@classmethod
def tearDownClass(cls):
if os.path.exists(cls.testfile):
os.remove(cls.testfile)

if os.path.exists(cls.testDir):
rmtree(cls.testDir)

def setUp(self):
#- remove testfile if leftover from a previous test
if os.path.exists(self.testfile):
Expand Down Expand Up @@ -90,9 +95,3 @@ def test_zscan_io(self):
self.assertTrue(np.all(d1==d2), 'data mismatch {}/{}/{}'.format(targetid, spectype, key))


def test_suite():
"""Allows testing of only this module with the command::
python setup.py test -m <modulename>
"""
return unittest.defaultTestLoader.loadTestsFromName(__name__)

0 comments on commit 38220d5

Please sign in to comment.