Skip to content

Commit

Permalink
Regression test for bug skypyproject#464
Browse files Browse the repository at this point in the history
  • Loading branch information
rrjbca committed May 14, 2021
1 parent 2fb6364 commit 51bf442
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions skypy/pipeline/tests/data/bug_464.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tables:
bug_table_1:
a: !numpy.random.uniform [0, 1, 10]
bug_table_2:
.init: !astropy.table.vstack
tables: [ $bug_table_1 ]
.depends: [ bug_table_1.complete ]
16 changes: 16 additions & 0 deletions skypy/pipeline/tests/test_skypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,25 @@ def test_logging(capsys):
assert(not err)


def test_init_depends():

# Regression test for pull request #464
# Previously the .depends keyword was also being passed to functions as a
# keyword argument. This was because of an inconsistency of how the config
# file was parsed and how the .depends keyword was handled by the Pipeline
# class during execution. The .depends keyword is now handled exclusively
# by the Call class.

# Run skypy with default verbosity and check log is empty
filename = get_pkg_data_filename('data/bug_464.yml')
output_file = 'bug_464.fits'
assert skypy.main([filename, output_file]) == 0


def teardown_module(module):

# Remove fits file generated in test_skypy
os.remove('bug_464.fits')
os.remove('empty.fits')
os.remove('logging.fits')
os.remove('test.fits')

0 comments on commit 51bf442

Please sign in to comment.