コード例 #1
0
ファイル: test_configs.py プロジェクト: MridulS/astropy
    def test_alias_read(self):
        from astropy.utils.data import conf

        with catch_warnings() as w:
            conf.reload()
            assert conf.remote_timeout == 42

        assert len(w) == 1
        assert str(w[0].message).startswith(
            "Config parameter 'name_resolve_timeout' in section "
            "[coordinates.name_resolve]")
コード例 #2
0
    def test_alias_read(self):
        from astropy.utils.data import conf

        with catch_warnings() as w:
            conf.reload()
            assert conf.remote_timeout == 42

        assert len(w) == 1
        assert str(w[0].message).startswith(
            "Config parameter 'name_resolve_timeout' in section "
            "[coordinates.name_resolve]")
コード例 #3
0
    def test_alias_read(self):
        from astropy.utils.data import conf

        with pytest.warns(
                AstropyDeprecationWarning,
                match=r"Config parameter 'name_resolve_timeout' in section "
                r"\[coordinates.name_resolve\].*") as w:
            conf.reload()
            assert conf.remote_timeout == 42

        assert len(w) == 1
コード例 #4
0
ファイル: test_configs.py プロジェクト: coder006/astropy
    def test_alias_read(self):
        from astropy.utils.data import conf

        with catch_warnings() as w:
            conf.reload()
            assert conf.remote_timeout == 42

        assert len(w) == 1
        assert str(w[0].message) == (
            "Config parameter 'name_resolve_timeout' in section "
            "[astropy.coordinates.name_resolve] is deprecated. Use "
            "'remote_timeout' in section [astropy.utils.data] instead.")
コード例 #5
0
ファイル: test_configs.py プロジェクト: Fr4nc3/astropy
def test_warning_move_to_top_level():
    # Check that the warning about deprecation config items in the
    # file works.  See #2514
    from ... import conf

    configuration._override_config_file = get_pkg_data_filename('data/deprecated.cfg')

    try:
        with catch_warnings(AstropyDeprecationWarning) as w:
            conf.reload()
            conf.max_lines
        assert len(w) == 1
    finally:
        configuration._override_config_file = None
        conf.reload()
コード例 #6
0
ファイル: test_configs.py プロジェクト: MridulS/astropy
def test_warning_move_to_top_level():
    # Check that the warning about deprecation config items in the
    # file works.  See #2514
    from ... import conf

    configuration._override_config_file = get_pkg_data_filename('data/deprecated.cfg')

    try:
        with catch_warnings(AstropyDeprecationWarning) as w:
            conf.reload()
            conf.max_lines
        assert len(w) == 1
    finally:
        configuration._override_config_file = None
        conf.reload()
コード例 #7
0
    def teardown_class(self):
        from astropy.utils.data import conf

        configuration._override_config_file = None
        conf.reload()
コード例 #8
0
ファイル: test_configs.py プロジェクト: MridulS/astropy
    def teardown_class(self):
        from astropy.utils.data import conf

        configuration._override_config_file = None
        conf.reload()