self_test

sunpy.self_test(**kwargs) [edit on github]

Run the tests for the package.

This method builds arguments for and then calls pytest.main.

Parameters

package

onlinebool, optional

Enable the online tests if True or disable them if False.

online_only: bool, optional

If True only online tests are run.

argsstr, optional

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

Ignore the docs directory if we have set test_path.

figurebool, optional

Enable the figure tests.

figure_testsstr, optional

Set the output directory for figure test images and hashes.

figure_onlybool, optional

Only run the figure tests.

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 or ‘auto’, optional

When provided, run the tests in parallel on the specified number of CPUs. If parallel is 'auto', it will use the all the cores on the machine. Requires the pytest-xdist plugin.

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.

pdbbool, optional

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

pep8bool, optional

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

pluginslist, optional

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

repeatint, optional

If set, specifies how many times each test should be run. This is useful for diagnosing sporadic failures.

skip_docsbool, optional

When True, skips running the doctests in the .rst files.

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.

verbosebool, optional

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