diff --git a/test/functional/test_dag.py b/test/functional/test_dag.py index 7a5079e6..e5eaf9a5 100644 --- a/test/functional/test_dag.py +++ b/test/functional/test_dag.py @@ -1,15 +1,9 @@ import io -import pytest - import conftest def test_put_get_resolve(client): - version = tuple(map(int, client.version()["Version"].split('-', 1)[0].split('.'))) - if version < (0, 5): - pytest.skip("IPFS DAG APIs first appeared in go-IPFS 0.5") - data = io.BytesIO(br'{"links": []}') response = client.dag.put(data) @@ -29,14 +23,9 @@ def test_put_get_resolve(client): def test_import_export(client): - version = tuple(map(int, client.version()["Version"].split('-', 1)[0].split('.'))) - if version < (0, 5): - pytest.skip("IPFS DAG APIs first appeared in go-IPFS 0.5") - # This file was created by inserting a simple JSON object into IPFS and # exporting it using `ipfs dag export > file.car` data_car = conftest.TEST_DIR / 'fake_json' / 'data.car' - data_car = str(data_car) #PY35 with open(data_car, 'rb') as file: response = client.dag.imprt(file) diff --git a/test/functional/test_miscellaneous.py b/test/functional/test_miscellaneous.py index 66c5f268..fc58fea8 100644 --- a/test/functional/test_miscellaneous.py +++ b/test/functional/test_miscellaneous.py @@ -27,8 +27,8 @@ def test_daemon_stop(daemon, client): # with access to the created daemon subprocess object defined directly # in the `test/run-test.py` file if not daemon: - pytest.skip("Not started using `test/run-test.py`") - + return + def daemon_is_running(): return daemon.poll() is None diff --git a/test/unit/test_http_httpx.py b/test/unit/test_http_httpx.py index dbcd3204..ba299a78 100644 --- a/test/unit/test_http_httpx.py +++ b/test/unit/test_http_httpx.py @@ -3,18 +3,15 @@ # `test_http.py` instead. import http.cookiejar import math -import sys - import pytest -if sys.version_info <= (3, 6): - pytest.skip("HTTPx requires Python 3.6+", allow_module_level=True) pytest.importorskip("ipfshttpclient.http_httpx") import ipfshttpclient.http_httpx cookiejar = http.cookiejar.CookieJar() + @pytest.mark.parametrize("kwargs,expected", [ ({}, {}), @@ -47,6 +44,7 @@ def test_map_args_to_httpx(kwargs, expected): assert ipfshttpclient.http_httpx.map_args_to_httpx(**kwargs) == expected + @pytest.mark.parametrize("args,kwargs,expected_kwargs,expected_base,expected_laddr", [ (("/dns/localhost/tcp/5001/http", "api/v0"), {}, { "params": [("stream-channels", "true")], @@ -70,4 +68,4 @@ def test_client_args_to_session_kwargs(args, kwargs, expected_kwargs, expected_b client = ipfshttpclient.http_httpx.ClientSync(*args, **kwargs) assert client._session_kwargs == expected_kwargs assert client._session_base == expected_base - assert client._session_laddr == expected_laddr \ No newline at end of file + assert client._session_laddr == expected_laddr