Skip to content

Running tests

Daniel Berke edited this page Feb 20, 2022 · 1 revision

VarConLib uses the Pytest framework for running automated tests.

Running tests

Tests can be run by running the following command in the main (i.e., top) varconlib directory (the one containing setup.cfg)

$ pytest

When first downloading VarConLib it is suggested to run Pytest to make sure everything is working. Afterwards, running tests will only be necessary if modifying the code. A full discussion of automated testing is outside the scope of this page, but Pytest's documentation is a good place to start.

Getting raw data for testing

VarConLib tests the creation of Star objects with a set of three observations of the star HD 117618. These are not huge, at ~2.3 MB each, but large enough that it was thought prudent to leave them out of the Git repository. These files can be downloaded from Dropbox using the following command, which should be run in varconlib/data/spectra (you may need to create this directory if it doesn't exist):

$ curl -OL https://www.dropbox.com/s/pnd0s88pbbmhk67/HD117618.zip
$ unzip HD117618.zip

This will create a directory within the spectra directory called HD117618, with three sub-directories each containing a .lzma compressed file of observed absorption feature fits from an observation of the star.