コード例 #1
0
def test_show_versions():
    f = io.StringIO()
    argopy.show_versions(file=f)
    assert "INSTALLED VERSIONS" in f.getvalue()
コード例 #2
0
ファイル: __init__.py プロジェクト: nobru-pereira/argopy
Test suite for argopy continuous integration

"""

import importlib
import pytest

import warnings
from argopy.errors import ErddapServerError, ArgovisServerError, DataNotFound
from aiohttp.client_exceptions import ServerDisconnectedError, ClientResponseError

import argopy

argopy.set_options(api_timeout=3 *
                   60)  # From Github actions, requests can take a while
argopy.show_versions()


def _importorskip(modname):
    try:
        importlib.import_module(modname)
        has = True
    except ImportError:
        has = False
    func = pytest.mark.skipif(not has, reason="requires {}".format(modname))
    return has, func


def _connectskip(connected, msg):
    func = pytest.mark.skipif(not connected, reason="requires {}".format(msg))
    return connected, func