Ejemplo n.º 1
0
def test_missing_dependencies_by_extra():
    missing = missing_dependencies_by_extra()
    assert sorted(list(missing.keys())) == sorted(['required', 'all', 'asdf', 'dask', 'database', 'dev', 'docs',
                                                   'image', 'jpeg2000', 'map', 'net', 'tests', 'timeseries',
                                                   'visualization'])
    missing = missing_dependencies_by_extra(exclude_extras=("all",))
    assert sorted(list(missing.keys())) == sorted(['required', 'asdf', 'dask', 'database', 'dev', 'docs',
                                                   'image', 'jpeg2000', 'map', 'net', 'tests', 'timeseries',
                                                   'visualization'])
Ejemplo n.º 2
0
def self_test(*,
              package=None,
              online=False,
              online_only=False,
              figure_only=False):
    print("\n\n")
    print("Starting sunpy self test...")
    print("Checking for packages needed to run sunpy:")
    missing = missing_dependencies_by_extra(
        exclude_extras=["asdf", "dask", "dev", "all", "docs"])
    test_missing = missing.pop("tests")
    printed = print_missing_dependencies_report(missing)
    if not printed:
        print("All required and optional sunpy dependencies are installed.")
    if test_missing:
        print(
            "You do not have all the required dependencies installed to run the sunpy test suite."
        )
        print(list(test_missing.keys()))
        print(
            "If are using conda, you will want to run `conda install <package name>`"
        )
        print('Otherwise you will want run `pip install "sunpy[all,tests]"`')
        return
    import pytest
    print("Starting the sunpy test suite:")
    print()
    args = _self_test_args(package=package,
                           online=online,
                           online_only=online_only,
                           figure_only=figure_only)
    return pytest.main(args)
Ejemplo n.º 3
0
def self_test(*,
              package=None,
              online=False,
              online_only=False,
              figure_only=False):
    print("\n\n")
    print("Starting sunpy self test...")
    print("Checking for packages needed to run sunpy:")
    missing = missing_dependencies_by_extra(exclude_extras=("asdf", "dask",
                                                            "dev", "all",
                                                            "docs"))
    test_missing = missing.pop("tests")
    printed = print_missing_dependencies_report(missing)
    if not printed:
        print("All required and optional sunpy dependencies are installed.")
    if test_missing:
        print(
            "You do not have all the required dependencies installed to run the sunpy test suite."
        )
        print(
            "If you want to run the sunpy tests install the 'tests' extra with `pip install sunpy[all,tests]`"
        )
        return
    import pytest
    print("Starting the sunpy test suite:")
    print()
    args = _self_test_args(package=package,
                           online=online,
                           online_only=online_only,
                           figure_only=figure_only)
    pytest.main(args)