test

astroplan.test(package=None, test_path=None, args=None, plugins=None, verbose=False, pastebin=None, remote_data=False, pep8=False, pdb=False, coverage=False, open_files=False, **kwargs)[source]

Run the tests using py.test. A proper set of arguments is constructed and passed to pytest.main.

Parameters
packagestr, optional

The name of a specific package to test, e.g. ‘io.fits’ or ‘utils’. If nothing is specified all default tests are run.

test_pathstr, optional

Specify location to test by path. May be a single file or directory. Must be specified absolutely or relative to the calling directory.

argsstr, optional

Additional arguments to be passed to pytest.main in the args keyword argument.

pluginslist, optional

Plugins to be passed to pytest.main in the plugins keyword argument.

verbosebool, optional

Convenience option to turn on verbose output from py.test. Passing True is the same as specifying '-v' in args.

pastebin{‘failed’,’all’,None}, optional

Convenience option for turning on py.test pastebin output. Set to 'failed' to upload info for failed tests, or 'all' to upload info for all tests.

remote_databool, optional

Controls whether to run tests marked with @remote_data. These tests use online data and are not run by default. Set to True to run these tests.

pep8bool, optional

Turn on PEP8 checking via the pytest-pep8 plugin and disable normal tests. Same as specifying '--pep8 -k pep8' in args.

pdbbool, optional

Turn on PDB post-mortem analysis for failing tests. Same as specifying '--pdb' in args.

coveragebool, optional

Generate a test coverage report. The result will be placed in the directory htmlcov.

open_filesbool, optional

Fail when any tests leave files open. Off by default, because this adds extra run time to the test suite. Requires the psutil package.

parallelint, optional

When provided, run the tests in parallel on the specified number of CPUs. If parallel is negative, it will use the all the cores on the machine. Requires the pytest-xdist plugin installed. Only available when using Astropy 0.3 or later.

kwargs

Any additional keywords passed into this function will be passed on to the astropy test runner. This allows use of test-related functionality implemented in later versions of astropy without explicitly updating the package template.