Skip to content

Add tests for scripts in io.fits #5799

Description

@elehcim

Tests are needed for astropy/io/fits/scripts/

  • astropy/io/fits/scripts/fitsdiff.py
  • astropy/io/fits/scripts/fitscheck.py
  • astropy/io/fits/scripts/fitsheader.py

Citing @bsipocz: "Having broken command line tools is much much worse than not having them at all".
Very true ;-)

cc @MSeifert04

Activity

  1. mohanagr commented on Mar 2, 2017

    @mohanagr
    Contributor

    I am writing a test for fitsheader. Is there any specific file in astropy/io/fits/tests/data/ I should use?

  2. MSeifert04 commented on Mar 2, 2017

    @MSeifert04
    Contributor

    @mohanagr At first, it would be nice to have some proof of concept that the CI properly test the script (so we can see if coverage and the CI work).

    So if you could submit a pull request for a script-test (doesn't matter which file) that would be really great 👍

  3. mohanagr commented on Mar 2, 2017

    @mohanagr
    Contributor

    @MSeifert04 Since I'm new to writing tests, for a start I'll just write a test to compare outputs for different options and submit a PR?

  4. elehcim commented on Mar 2, 2017

    @elehcim
    ContributorAuthor

    @mohanagr If you want you can use as a template the tests here: astropy/io/fits/tests/test_fitsdiff.py

  5. MSeifert04 commented on Mar 2, 2017

    @MSeifert04
    Contributor

    I'll just write a test to compare outputs for different options and submit a PR?

    That sounds good.

  6. mohanagr commented on Mar 3, 2017

    @mohanagr
    Contributor

    The other tests use the customcatch_warnings class but since that inherits from warnings.catch_warnings that'll catch emitted warnings, right. How to get the ones which are logged?
    My case: I was writing a test for fitsheader. The script warns if -k option is used and the given keyword is not found.
    Same goes for errors. Eg. if file not found. It logs the Error.

  7. MSeifert04 commented on Mar 3, 2017

    @MSeifert04
    Contributor

    @mohanagr Is there a need to test exceptional (or warning) cases? Aren't these already tested in the not-script-version of the script?

  8. mohanagr commented on Mar 3, 2017

    @mohanagr
    Contributor

    @MSeifert04 I saw your comment late. I have implemented a few tests in the initial commit. Please go through.

  9. pllim commented on Sep 28, 2017

    @pllim
    Member

    All the checkboxes are checked, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions