예제 #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
파일: conftest.py 프로젝트: adrn/astroplan
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'