From: Stefan Eissing Date: Tue, 5 Sep 2023 07:10:00 +0000 (+0200) Subject: pytest: fix check for slow_network skips to only apply when intended X-Git-Tag: curl-8_3_0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8a82140aa02521e661a82e0f97d3dfc736af991;p=thirdparty%2Fcurl.git pytest: fix check for slow_network skips to only apply when intended Closes #11801 --- diff --git a/tests/http/test_02_download.py b/tests/http/test_02_download.py index 38db3372bb..d6bfe9cd36 100644 --- a/tests/http/test_02_download.py +++ b/tests/http/test_02_download.py @@ -200,7 +200,7 @@ class TestDownload: ]) r.check_response(count=count, http_status=200) - @pytest.mark.skipif(condition=Env.slow_network, reason="not suitable for slow network tests") + @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_02_10_10MB_serial(self, env: Env, httpd, nghttpx, repeat, proto): @@ -212,7 +212,7 @@ class TestDownload: r = curl.http_download(urls=[urln], alpn_proto=proto) r.check_response(count=count, http_status=200) - @pytest.mark.skipif(condition=Env.slow_network, reason="not suitable for slow network tests") + @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_02_11_10MB_parallel(self, env: Env, httpd, nghttpx, repeat, proto): @@ -254,7 +254,7 @@ class TestDownload: ]) r.check_response(count=count, http_status=200) - @pytest.mark.skipif(condition=Env.slow_network, reason="not suitable for slow network tests") + @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") def test_02_20_h2_small_frames(self, env: Env, httpd, repeat): # Test case to reproduce content corruption as observed in # https://github.com/curl/curl/issues/10525 diff --git a/tests/http/test_04_stuttered.py b/tests/http/test_04_stuttered.py index 41dc55992a..818d333a93 100644 --- a/tests/http/test_04_stuttered.py +++ b/tests/http/test_04_stuttered.py @@ -35,7 +35,7 @@ from testenv import Env, CurlClient log = logging.getLogger(__name__) -@pytest.mark.skipif(condition=Env.slow_network, reason="not suitable for slow network tests") +@pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") class TestStuttered: @pytest.fixture(autouse=True, scope='class') diff --git a/tests/http/test_08_caddy.py b/tests/http/test_08_caddy.py index 0faba9b4ef..aa69e620ed 100644 --- a/tests/http/test_08_caddy.py +++ b/tests/http/test_08_caddy.py @@ -110,7 +110,7 @@ class TestCaddy: assert r.total_connects == 1, r.dump_logs() # download 5MB files sequentially - @pytest.mark.skipif(condition=Env.slow_network, reason="not suitable for slow network tests") + @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_08_04a_download_10mb_sequential(self, env: Env, caddy: Caddy, repeat, proto): @@ -125,7 +125,7 @@ class TestCaddy: r.check_response(count=count, http_status=200, connect_count=1) # download 10MB files sequentially - @pytest.mark.skipif(condition=Env.slow_network, reason="not suitable for slow network tests") + @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['h2', 'h3']) def test_08_04b_download_10mb_sequential(self, env: Env, caddy: Caddy, repeat, proto): @@ -140,7 +140,7 @@ class TestCaddy: r.check_response(count=count, http_status=200, connect_count=1) # download 10MB files parallel - @pytest.mark.skipif(condition=Env.slow_network, reason="not suitable for slow network tests") + @pytest.mark.skipif(condition=Env().slow_network, reason="not suitable for slow network tests") @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3']) def test_08_05_download_1mb_parallel(self, env: Env, caddy: Caddy, repeat, proto):