TestRunner¶
-
class
astropy.tests.runner.
TestRunner
(base_path)[source] [edit on github]¶ Bases:
astropy.tests.runner.TestRunnerBase
A test runner for astropy tests
Attributes Summary
keywords
Methods Summary
args
(*args, **kwargs)args : str, optional coverage
(*args, **kwargs)docs_path
(*args, **kwargs)docs_path : str, optional open_files
(*args, **kwargs)open_files : bool, optional package
(*args, **kwargs)package : str, optional parallel
(*args, **kwargs)parallel : int, optional pastebin
(*args, **kwargs)pastebin : (‘failed’, ‘all’, None), optional pdb
(*args, **kwargs)pdb : bool, optional pep8
(*args, **kwargs)pep8 : bool, optional plugins
(*args, **kwargs)plugins : list, optional remote_data
(*args, **kwargs)remote_data : {‘none’, ‘astropy’, ‘any’}, optional repeat
(*args, **kwargs)repeat : int
, optionalrun_tests
(**kwargs)Run the tests for the package. skip_docs
(*args, **kwargs)skip_docs : bool
, optionaltest_path
(*args, **kwargs)test_path : str, optional verbose
(*args, **kwargs)verbose : bool, optional Attributes Documentation
-
keywords
= OrderedDict([('coverage', None), ('package', None), ('args', None), ('docs_path', None), ('open_files', None), ('parallel', 0), ('pastebin', None), ('pdb', None), ('pep8', None), ('plugins', None), ('remote_data', 'none'), ('repeat', None), ('skip_docs', None), ('test_path', None), ('verbose', None)])¶
Methods Documentation
-
args
(*args, **kwargs)[source] [edit on github]¶ - args : str, optional
- Additional arguments to be passed to
pytest.main
in theargs
keyword argument.
-
coverage
(*args, **kwargs)[source] [edit on github]¶
-
docs_path
(*args, **kwargs)[source] [edit on github]¶ - docs_path : str, optional
- The path to the documentation .rst files.
-
open_files
(*args, **kwargs)[source] [edit on github]¶ - open_files : bool, 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.
-
package
(*args, **kwargs)[source] [edit on github]¶ - package : str, optional
- The name of a specific package to test, e.g. ‘io.fits’ or ‘utils’. If nothing is specified all default Astropy tests are run.
-
parallel
(*args, **kwargs)[source] [edit on github]¶ - parallel : int, 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.
-
pastebin
(*args, **kwargs)[source] [edit on github]¶ - 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.
-
pdb
(*args, **kwargs)[source] [edit on github]¶ - pdb : bool, optional
- Turn on PDB post-mortem analysis for failing tests. Same as
specifying
--pdb
inargs
.
-
pep8
(*args, **kwargs)[source] [edit on github]¶ - pep8 : bool, optional
- Turn on PEP8 checking via the pytest-pep8 plugin and disable normal
tests. Same as specifying
--pep8 -k pep8
inargs
.
-
plugins
(*args, **kwargs)[source] [edit on github]¶ - plugins : list, optional
- Plugins to be passed to
pytest.main
in theplugins
keyword argument.
-
remote_data
(*args, **kwargs)[source] [edit on github]¶ - remote_data : {‘none’, ‘astropy’, ‘any’}, optional
- Controls whether to run tests marked with @remote_data. This can be
set to run no tests with remote data (
none
), only ones that use data from http://data.astropy.org (astropy
), or all tests that use remote data (any
). The default isnone
.
-
repeat
(*args, **kwargs)[source] [edit on github]¶ - repeat :
int
, optional - If set, specifies how many times each test should be run. This is useful for diagnosing sporadic failures.
- repeat :
-
run_tests
(**kwargs)[source] [edit on github]¶ Run the tests for the package.
Parameters: package : str, optional
The name of a specific package to test, e.g. ‘io.fits’ or ‘utils’. If nothing is specified all default Astropy tests are run.
args : str, optional
Additional arguments to be passed to
pytest.main
in theargs
keyword argument.docs_path : str, optional
The path to the documentation .rst files.
open_files : bool, 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.parallel : int, 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.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.
pdb : bool, optional
Turn on PDB post-mortem analysis for failing tests. Same as specifying
--pdb
inargs
.pep8 : bool, optional
Turn on PEP8 checking via the pytest-pep8 plugin and disable normal tests. Same as specifying
--pep8 -k pep8
inargs
.plugins : list, optional
Plugins to be passed to
pytest.main
in theplugins
keyword argument.remote_data : {‘none’, ‘astropy’, ‘any’}, optional
Controls whether to run tests marked with @remote_data. This can be set to run no tests with remote data (
none
), only ones that use data from http://data.astropy.org (astropy
), or all tests that use remote data (any
). The default isnone
.repeat :
int
, optionalIf set, specifies how many times each test should be run. This is useful for diagnosing sporadic failures.
skip_docs :
bool
, optionalWhen
True
, skips running the doctests in the .rst files.test_path : str, optional
Specify location to test by path. May be a single file or directory. Must be specified absolutely or relative to the calling directory.
verbose : bool, optional
Convenience option to turn on verbose output from py.test. Passing True is the same as specifying
-v
inargs
.See also
pytest.main
- This method builds arguments for and then calls this function.
-
skip_docs
(*args, **kwargs)[source] [edit on github]¶
-
test_path
(*args, **kwargs)[source] [edit on github]¶ - test_path : str, optional
- Specify location to test by path. May be a single file or directory. Must be specified absolutely or relative to the calling directory.
-
verbose
(*args, **kwargs)[source] [edit on github]¶ - verbose : bool, optional
- Convenience option to turn on verbose output from py.test. Passing
True is the same as specifying
-v
inargs
.
-