From: Daniele Varrazzo Date: Tue, 1 Nov 2022 23:38:50 +0000 (+0100) Subject: test: skip high fd number test on Windows X-Git-Tag: 3.1.5~7^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=238c9e1a7e3911f3fae3d4ce16c9efdd885691f2;p=thirdparty%2Fpsycopg.git test: skip high fd number test on Windows Windows is pretty simple in regards of the wait function, because it only implement select, and it doesn't have the same limit of the Unix select. However this test sometimes fails in weird ways: on the pgconn.socket > 1024 assert, for instance. So, let's just skip it. --- diff --git a/tests/test_waiting.py b/tests/test_waiting.py index e187af13a..63237e879 100644 --- a/tests/test_waiting.py +++ b/tests/test_waiting.py @@ -80,6 +80,9 @@ def test_wait_bad(pgconn, waitfn): @pytest.mark.slow +@pytest.mark.skipif( + "sys.platform == 'win32'", reason="win32 works ok, but FDs are mysterious" +) @pytest.mark.parametrize("waitfn", waitfns) def test_wait_large_fd(dsn, waitfn): waitfn = getattr(waiting, waitfn) @@ -97,7 +100,7 @@ def test_wait_large_fd(dsn, waitfn): assert pgconn.socket > 1024 pgconn.send_query(b"select 1") gen = generators.execute(pgconn) - if waitfn is waiting.wait_select and sys.platform != "win32": + if waitfn is waiting.wait_select: with pytest.raises(ValueError): waitfn(gen, pgconn.socket) else: