[AstroPy] Tests for AstroPy (was POLL: vision for a common Astronomy package)

Brian Kloppenborg bkloppenborg at gmail.com
Wed Jul 6 11:52:27 EDT 2011



On 07/06/2011 09:35 AM, Victoria G. Laidler wrote:
> Ole Streicher wrote:
>> BTW, are there ideas for regression tests of astropy? Especially in the
>> case you mentioned, this would be *very* helpful to check that
>> everything works in the target system.
> I was thinking about this as well. I suggest that there be minimum
> testing standards for astropy packages. Packages should come with tests
> that:
> - can be run using a standard syntax (what?)
> - verify that all significant elements of the package can successfully
> execute
> - verify that all significant elements of the package, for some minimum
> set of common use cases, give the right answer when run
> - come with documentation that in some way describe test coverage (how
> much of the system do the tests cover) and the source of the test
> answers (ie, how did you determine the "right answer" used in the tests)
There is a nice unit testing package in python that could be used for this:
http://docs.python.org/library/unittest.html

I use it quite frequently on larger projects.  Implementing is as simple 
as a series of Assert statements whose outcome is known (i.e. hard-coded).

Brian



More information about the AstroPy mailing list