diff --git a/test/unit/test_client.py b/test/unit/test_client.py index 190faf91..ab736294 100644 --- a/test/unit/test_client.py +++ b/test/unit/test_client.py @@ -1,14 +1,15 @@ import pytest +import warnings import ipfshttpclient def test_assert_version(): - with pytest.warns(None) as warnings: + with warnings.catch_warnings(): # Minimum required version ipfshttpclient.assert_version("0.1.0", "0.1.0", "0.2.0", ["0.1.2"]) - assert len(warnings) == 0 + warnings.simplefilter("error") # Too high version with pytest.warns(ipfshttpclient.exceptions.VersionMismatch): @@ -41,4 +42,4 @@ def test_client_session_context(): assert client._client._session is None with client: assert client._client._session is not None - assert client._client._session is None \ No newline at end of file + assert client._client._session is None diff --git a/tox.ini b/tox.ini index 56584c6e..c1064928 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ isolated_build = true [testenv] deps = - pytest ~= 6.2 + pytest >= 7.0.0 pytest-cov ~= 2.11 pytest-dependency ~= 0.5 pytest-localserver ~= 0.5