Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-116303: Skip test module dependent tests if test modules are disabled#116307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Changes from1 commit
Commits
Show all changes
40 commits
Select commitHold shift + click to select a range
9b3f0f7
gh-116303: Skip some sqlite3 tests if testcapi is unavailable
erlend-aaslandMar 4, 2024
0f6f74e
Skip more tests
erlend-aaslandMar 4, 2024
2f750c3
Split up sqlite3 tests
erlend-aaslandMar 4, 2024
7c4477d
Amend previous commit
erlend-aaslandMar 4, 2024
a9c6f62
Pull in main
erlend-aaslandMar 4, 2024
cdc6df4
Use import_helper iso. requires_limited_api
erlend-aaslandMar 5, 2024
d05dcd7
More skips
erlend-aaslandMar 5, 2024
cb7cff4
Fix gc and weakref tests
erlend-aaslandMar 5, 2024
ad5e3b6
Remove local debug stuff
erlend-aaslandMar 5, 2024
cdb8bf4
Fix test_os
erlend-aaslandMar 5, 2024
e4a30b0
Fixup stable_abi.py
erlend-aaslandMar 5, 2024
fabb007
Fixup run_in_subinterp
erlend-aaslandMar 5, 2024
c51dafa
Fixup test_call
erlend-aaslandMar 5, 2024
c3f9c99
Fixup test_audit
erlend-aaslandMar 5, 2024
fde9548
Fix some _testsinglephase issues
erlend-aaslandMar 5, 2024
ea72ced
Address review: use setUpClass in test_call; don't skip everything
erlend-aaslandMar 5, 2024
628896c
Address review: no need to skip in tearDown
erlend-aaslandMar 5, 2024
88c6739
Address review: check import at the top of test_threading.test_frame_…
erlend-aaslandMar 5, 2024
c02cd6f
Fixup some test.support helpers
erlend-aaslandMar 5, 2024
d49532b
Fixup test_coroutines
erlend-aaslandMar 5, 2024
2427111
Fixup test_threading
erlend-aaslandMar 5, 2024
25d0999
Fixup test_repl
erlend-aaslandMar 5, 2024
bdd8cff
Fixup test_monitoring
erlend-aaslandMar 5, 2024
ee9fa51
Amend test_embed
erlend-aaslandMar 5, 2024
a47c5ff
Amend test_audit
erlend-aaslandMar 5, 2024
d84a5c4
Fix test_socket
erlend-aaslandMar 5, 2024
e877ffb
Resolve test_exceptions nicer
erlend-aaslandMar 5, 2024
1ec0c66
Merge branch 'main' into sqlite/testcapi
erlend-aaslandMar 5, 2024
afa58a9
Use import_helper in test_importlib
erlend-aaslandMar 5, 2024
760c6cb
Fixup test_embed
erlend-aaslandMar 5, 2024
d7f060a
Pull in main
erlend-aaslandMar 5, 2024
a1106b7
Revert spurious docs change
erlend-aaslandMar 5, 2024
db45852
Workaround: use a different test module name in test_module_resources
erlend-aaslandMar 5, 2024
ccd8bea
gh-116307: Create a new import helper 'isolated modules' and use that…
jaracoMar 6, 2024
f80f75e
Merge branch 'main' into sqlite/testcapi
erlend-aaslandMar 6, 2024
39d135d
Revert "Workaround: use a different test module name in test_module_r…
erlend-aaslandMar 6, 2024
13c4829
Revert another spurious test_importlib change
erlend-aaslandMar 6, 2024
31e19a7
Fix test_embed
erlend-aaslandMar 7, 2024
45e0586
Pull in main
erlend-aaslandMar 7, 2024
a148fb5
Remove useless import from test_embed
erlend-aaslandMar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fix test_socket
  • Loading branch information
@erlend-aasland
erlend-aasland committedMar 5, 2024
commitd84a5c497e8bf4b804a1de6a270eb418466d2b82
42 changes: 28 additions & 14 deletionsLib/test/test_socket.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,6 @@
from test.support import (
is_apple, os_helper, refleak_helper, socket_helper, threading_helper
)
from test.support.import_helper import import_module
import _thread as thread
import array
import contextlib
Expand DownExpand Up@@ -37,6 +36,10 @@
import fcntl
except ImportError:
fcntl = None
try:
import _testcapi
except ImportError:
_testcapi = None

support.requires_working_socket(module=True)

Expand DownExpand Up@@ -1170,8 +1173,9 @@ def testNtoH(self):
self.assertRaises(OverflowError, func, 1<<34)

@support.cpython_only
@unittest.skipIf(_testcapi is None, "requires _testcapi")
def testNtoHErrors(self):
_testcapi = import_module("_testcapi")
import_testcapi
s_good_values = [0, 1, 2, 0xffff]
l_good_values = s_good_values + [0xffffffff]
l_bad_values = [-1, -2, 1<<32, 1<<1000]
Expand DownExpand Up@@ -1636,6 +1640,7 @@ def testGetaddrinfo(self):
except socket.gaierror:
pass

@unittest.skipIf(_testcapi is None, "requires _testcapi")
def test_getaddrinfo_int_port_overflow(self):
# gh-74895: Test that getaddrinfo does not raise OverflowError on port.
#
Expand All@@ -1649,9 +1654,9 @@ def test_getaddrinfo_int_port_overflow(self):
# prior to 3.12 did for ints outside of a [LONG_MIN, LONG_MAX] range.
# Leave the error up to the underlying string based platform C API.

_testcapi= import_module("_testcapi")
from_testcapiimport ULONG_MAX, LONG_MAX, LONG_MIN
try:
socket.getaddrinfo(None,_testcapi.ULONG_MAX + 1, type=socket.SOCK_STREAM)
socket.getaddrinfo(None, ULONG_MAX + 1, type=socket.SOCK_STREAM)
except OverflowError:
# Platforms differ as to what values consitute a getaddrinfo() error
# return. Some fail for LONG_MAX+1, others ULONG_MAX+1, and Windows
Expand All@@ -1661,21 +1666,21 @@ def test_getaddrinfo_int_port_overflow(self):
pass

try:
socket.getaddrinfo(None,_testcapi.LONG_MAX + 1, type=socket.SOCK_STREAM)
socket.getaddrinfo(None, LONG_MAX + 1, type=socket.SOCK_STREAM)
except OverflowError:
self.fail("Either no error or socket.gaierror expected.")
except socket.gaierror:
pass

try:
socket.getaddrinfo(None,_testcapi.LONG_MAX - 0xffff + 1, type=socket.SOCK_STREAM)
socket.getaddrinfo(None, LONG_MAX - 0xffff + 1, type=socket.SOCK_STREAM)
except OverflowError:
self.fail("Either no error or socket.gaierror expected.")
except socket.gaierror:
pass

try:
socket.getaddrinfo(None,_testcapi.LONG_MIN - 1, type=socket.SOCK_STREAM)
socket.getaddrinfo(None, LONG_MIN - 1, type=socket.SOCK_STREAM)
except OverflowError:
self.fail("Either no error or socket.gaierror expected.")
except socket.gaierror:
Expand DownExpand Up@@ -1829,9 +1834,10 @@ def test_listen_backlog(self):
srv.listen()

@support.cpython_only
@unittest.skipIf(_testcapi is None, "requires _testcapi")
def test_listen_backlog_overflow(self):
# Issue 15989
_testcapi = import_module("_testcapi")
import_testcapi
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as srv:
srv.bind((HOST, 0))
self.assertRaises(OverflowError, srv.listen, _testcapi.INT_MAX + 1)
Expand DownExpand Up@@ -2710,24 +2716,31 @@ def testDup(self):
def _testDup(self):
self.serv_conn.send(MSG)

deftestShutdown(self):
#Testing shutdown()
defcheck_shutdown(self):
#Test shutdown() helper
msg = self.cli_conn.recv(1024)
self.assertEqual(msg, MSG)
# wait for _testShutdown to finish: on OS X, when the server
# wait for _testShutdown[_overflow] to finish: on OS X, when the server
# closes the connection the client also becomes disconnected,
# and the client's shutdown call will fail. (Issue #4397.)
self.done.wait()

def testShutdown(self):
self.check_shutdown()

def _testShutdown(self):
self.serv_conn.send(MSG)
self.serv_conn.shutdown(2)

testShutdown_overflow = support.cpython_only(testShutdown)
@support.cpython_only
@unittest.skipIf(_testcapi is None, "requires _testcapi")
def testShutdown_overflow(self):
self.check_shutdown()

@support.cpython_only
@unittest.skipIf(_testcapi is None, "requires _testcapi")
def _testShutdown_overflow(self):
_testcapi = import_module("_testcapi")
import_testcapi
self.serv_conn.send(MSG)
# Issue 15989
self.assertRaises(OverflowError, self.serv_conn.shutdown,
Expand DownExpand Up@@ -4882,9 +4895,10 @@ def _testSetBlocking(self):
pass

@support.cpython_only
@unittest.skipIf(_testcapi is None, "requires _testcapi")
def testSetBlocking_overflow(self):
# Issue 15989
_testcapi = import_module("_testcapi")
import_testcapi
if _testcapi.UINT_MAX >= _testcapi.ULONG_MAX:
self.skipTest('needs UINT_MAX < ULONG_MAX')

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp