Skip to content

Commit

Permalink
Remove pytest skips related to old, unsupported versions of Python an…
Browse files Browse the repository at this point in the history
…d IPFS
  • Loading branch information
c0llab0rat0r authored and ntninja committed May 30, 2021
1 parent 8f628ce commit c03867a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
11 changes: 0 additions & 11 deletions test/functional/test_dag.py
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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 <cid> > 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)
Expand Down
4 changes: 2 additions & 2 deletions test/functional/test_miscellaneous.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 3 additions & 5 deletions test/unit/test_http_httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", [
({}, {}),
Expand Down Expand Up @@ -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")],
Expand All @@ -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
assert client._session_laddr == expected_laddr

0 comments on commit c03867a

Please sign in to comment.