示例#1
0
def pytest_configure(config):
    if hasattr(astropy_pytest_plugins, 'pytest_configure'):
        # sure ought to be true right now, but always possible it will change in
        # future versions of astropy
        astropy_pytest_plugins.pytest_configure(config)

    # make sure astroplan warnings always appear so we can test when they show up
    warnings.simplefilter('always', category=AstroplanWarning)

    # activate image comparison tests only if the dependencies needed are installed:
    # matplotlib, nose, pytest-mpl
    try:
        import matplotlib
        import nose  # needed for the matplotlib testing tools
        HAS_MATPLOTLIB_AND_NOSE = True
    except ImportError:
        HAS_MATPLOTLIB_AND_NOSE = False

    if HAS_MATPLOTLIB_AND_NOSE and config.pluginmanager.hasplugin('mpl'):
        pass
        # TODO: turn image comparison tests back on once this issue is figured out:
        # https://github.com/astropy/astroplan/pull/104#issuecomment-137734007
        # config.option.mpl = True
        # config.option.mpl_baseline_path = 'astroplan/plots/tests/baseline_images'

    # Activate remote data mocking if the `--remote-data` option isn't used:
    if (not config.getoption('remote_data')
            or config.getvalue('remote_data') == 'none'):
        _mock_remote_data()
示例#2
0
def pytest_configure(config):
    if hasattr(astropy_pytest_plugins, 'pytest_configure'):
        # sure ought to be true right now, but always possible it will change in
        # future versions of astropy
        astropy_pytest_plugins.pytest_configure(config)

    # make sure astroplan warnings always appear so we can test when they show up
    warnings.simplefilter('always', category=AstroplanWarning)

    # activate image comparison tests only if the dependencies needed are installed:
    # matplotlib, nose, pytest-mpl
    try:
        import matplotlib
        import nose  # needed for the matplotlib testing tools
        HAS_MATPLOTLIB_AND_NOSE = True
    except ImportError:
        HAS_MATPLOTLIB_AND_NOSE = False

    if HAS_MATPLOTLIB_AND_NOSE and config.pluginmanager.hasplugin('mpl'):
        pass
        # TODO: turn image comparison tests back on once this issue is figured out:
        # https://github.com/astropy/astroplan/pull/104#issuecomment-137734007
        # config.option.mpl = True
        # config.option.mpl_baseline_path = 'astroplan/plots/tests/baseline_images'

    # Activate remote data mocking if the `--remote-data` option isn't used:
    if not config.getoption('remote_data'):
        _mock_remote_data()
示例#3
0
def pytest_configure(config):
    if config.getoption('remote_data'):
        pass
    else:
        turn_off_internet(verbose=config.option.verbose)

    try:
        from astropy.tests.pytest_plugins import pytest_configure

        pytest_configure(config)
    except ImportError:
        # assume astropy v<0.3
        pass
示例#4
0
def pytest_configure(config):
    if config.getoption('remote_data'):
        pass
    else:
        turn_off_internet(verbose=config.option.verbose)

    try:
        from astropy.tests.pytest_plugins import pytest_configure

        pytest_configure(config)
    except ImportError:
        # assume astropy v<0.3
        pass
示例#5
0
def pytest_configure(config):
    if hasattr(astropy_pytest_plugins, 'pytest_configure'):
        # sure ought to be true right now, but always possible it will change in
        # future versions of astropy
        astropy_pytest_plugins.pytest_configure(config)

    # make sure astroplan warnings always appear so we can test when they show
    # up
    warnings.simplefilter('always', category=AstroplanWarning)

    # Activate remote data mocking if the `--remote-data` option isn't used:
    if (not config.getoption('remote_data')
            or config.getvalue('remote_data') == 'none'):
        _mock_remote_data()
示例#6
0
def pytest_configure(config):
    if hasattr(astropy_pytest_plugins, 'pytest_configure'):
        # sure ought to be true right now, but always possible it will change in
        # future versions of astropy
        astropy_pytest_plugins.pytest_configure(config)

    # activate image comparison tests only if the dependencies needed are installed:
    # matplotlib, nose, pytest-mpl
    try:
        import matplotlib
        import nose  # needed for the matplotlib testing tools
        HAS_MATPLOTLIB_AND_NOSE = True
    except ImportError:
        HAS_MATPLOTLIB_AND_NOSE = False

    if HAS_MATPLOTLIB_AND_NOSE and config.pluginmanager.hasplugin('mpl'):
        pass
示例#7
0
def pytest_configure(config):
    if hasattr(astropy_pytest_plugins, 'pytest_configure'):
        # sure ought to be true right now, but always possible it will change in
        # future versions of astropy
        astropy_pytest_plugins.pytest_configure(config)

    #make sure astroplan warnings always appear so we can test when they show up
    warnings.simplefilter('always', category=AstroplanWarning)

    try:
        import matplotlib
        import nose  # needed for the matplotlib testing tools
        HAS_MATPLOTLIB_AND_NOSE = True
    except ImportError:
        HAS_MATPLOTLIB_AND_NOSE = False

    if HAS_MATPLOTLIB_AND_NOSE and config.pluginmanager.hasplugin('mpl'):
        config.option.mpl = True
        config.option.mpl_baseline_path = 'astroplan/plots/tests/baseline_images'
示例#8
0
def pytest_configure(config):
    if hasattr(astropy_pytest_plugins, 'pytest_configure'):
        # sure ought to be true right now, but always possible it will change in
        # future versions of astropy
        astropy_pytest_plugins.pytest_configure(config)

    #make sure astroplan warnings always appear so we can test when they show up
    warnings.simplefilter('always', category=AstroplanWarning)

    try:
        import matplotlib
        import nose  # needed for the matplotlib testing tools
        HAS_MATPLOTLIB_AND_NOSE = True
    except ImportError:
        HAS_MATPLOTLIB_AND_NOSE = False

    if HAS_MATPLOTLIB_AND_NOSE and config.pluginmanager.hasplugin('mpl'):
            config.option.mpl = True
            config.option.mpl_baseline_path = 'astroplan/plots/tests/baseline_images'